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.
const DataTypePtr & left_arg_type,
    const std::shared_ptr<ASTFunction> & right_arg,
    const DataTypes & set_element_types,
    const Context & context)
{
    auto get_tuple_type_from_ast = [&context](const auto & func) -> DataTypePtr
    {
        if (func && (func->name == "tuple" || func->name == "array") && !func->arguments->children.empty())
        {
            
            auto element = func->arguments->children.at(0);
            std::pair<Field, DataTypePtr> value_raw = evaluateConstantExpression(element, context);
            return std::make_shared<DataTypeTuple>(DataTypes({value_raw.second}));
        }
        return evaluateConstantExpression(func, context).second;
    };
    const DataTypePtr & right_arg_type = get_tuple_type_from_ast(right_arg);
    size_t left_tuple_depth = getTypeDepth(left_arg_type);
    size_t right_tuple_depth = getTypeDepth(right_arg_type);
    ASTPtr elements_ast;
    
    if (left_tuple_depth == right_tuple_depth)
    {
        ASTPtr exp_list = std::make_shared<ASTExpressionList>();
        exp_list->children.push_back(right_arg);
        elements_ast = exp_list;