The query

```
SELECT (1, 2) IN ((-9223372036854775808, (256, 10)), (3, 4), ((((((10 IN (NULL, 1048577, 1.)) IN (inf, NULL, NULL)) IN (((7 IN (-1, 2, 3, 1025, 1025)) IN (NULL, 1023 IN (inf, 1048576, (7, 100, 1024, 3)), NULL, 100.0000991821289)) IN (256, 65537), -9223372036854775808, 1048575)) IN (-2, NULL, 10 IN (NULL, 10, -2, 1.000100016593933))) IN (10 IN (NULL, 10, -2, 1.000100016593933), 1048577, 0.)) IN (65536, ((-2, 9223372036854775807 IN (-2, 10, 1025, 1., -1), 1025, 1., -1), 100, 4, 1025), NULL), 6), (7, 8), (1024, 6))
SETTINGS max_temporary_columns = 4
```

Triggers logical error exception.
}
    
    else if (left_tuple_depth + 1 == right_tuple_depth)
    {
        const auto * set_func = right_arg->as<ASTFunction>();
        if (!set_func || (set_func->name != "tuple" && set_func->name != "array"))
            throw Exception("Incorrect type of 2nd argument for function 'in'"
                            ". Must be subquery or set of elements with type " + left_arg_type->getName() + ".",
                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        elements_ast = set_func->arguments;
    }
    else
        throw Exception("Invalid types for IN function: "
                        + left_arg_type->getName() + " and " + right_arg_type->getName() + ".",
                        ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
    return createBlockFromAST(elements_ast, set_element_types, context);
}
SetPtr makeExplicitSet(
    const ASTFunction * node, const Block & sample_block, bool create_ordered_set,
    const Context & context, const SizeLimits & size_limits, PreparedSets & prepared_sets)
{
    const IAST & args = *node->arguments;
    if (args.children.size() != 2)
        throw Exception("Wrong number of arguments passed to function in", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
    const ASTPtr & left_arg = args.children.at(0);
    const ASTPtr & right_arg = args.children.at(1);
    const DataTypePtr & left_arg_type = sample_block.getByName(left_arg->getColumnName()).type;
    DataTypes set_element_types = {left_arg_type};
    const auto * left_tuple_type = typeid_cast<const DataTypeTuple *>(left_arg_type.get());
    if (left_tuple_type && left_tuple_type->getElements().size() != 1)