Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liuneng1994 committed Mar 20, 2024
1 parent 761c612 commit a29d4f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Analyzer/Passes/ConvertInToEqualPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ class ConvertInToEqualPassVisitor : public InDepthQueryTreeVisitorWithContext<Co
return ;
if (constant_node->getValue().getType() == Field::Types::Which::Tuple)
return;
auto const_value = std::make_shared<ConstantNode>(constant_node->getValue());

auto equal_resolver = createInternalFunctionEqualOverloadResolver();
auto equal = std::make_shared<FunctionNode>("equals");
QueryTreeNodes arguments{column_node->clone(), const_value};
QueryTreeNodes arguments{column_node->clone(), constant_node->clone()};
equal->getArguments().getNodes() = std::move(arguments);
equal->resolveAsFunction(equal_resolver);
node = equal;
Expand Down
1 change: 1 addition & 0 deletions src/Core/SettingsChangesHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static std::map<ClickHouseVersion, SettingsChangesHistory::SettingsChanges> sett
{"parallel_replicas_allow_in_with_subquery", false, true, "If true, subquery for IN will be executed on every follower replica"},
{"filesystem_cache_reserve_space_wait_lock_timeout_milliseconds", 1000, 1000, "Wait time to lock cache for sapce reservation in filesystem cache"},
{"max_parser_backtracks", 0, 1000000, "Limiting the complexity of parsing"},
{"optimize_in_to_equal", false, true, "Convert in single value to equal"},
}},
{"24.2", {{"allow_suspicious_variant_types", true, false, "Don't allow creating Variant type with suspicious variants by default"},
{"validate_experimental_and_suspicious_types_inside_nested_types", false, true, "Validate usage of experimental and suspicious types inside nested types"},
Expand Down
4 changes: 1 addition & 3 deletions tests/performance/function_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
ENGINE = Memory
</create_query>
<fill_query>insert into t_nullable select ['aaaaaa','bbaaaa','ccaaaa','ddaaaa'][number % 101 + 1], ['aa','bb','cc','dd'][number % 100 + 1], ['aa','bb','cc','dd'][number % 102 + 1], number%10+1, number%10+2, number%10+3, number%10+4,number%10+5, number%6000+1, number%5000+2 from numbers_mt(30000000)</fill_query>
<query>select * from t_nullable where key_string1 in ('aaaaaa') format Null</query>
<query>select * from t_nullable where key_string1 in ('aaaaaa') format Null SETTINGS allow_experimental_analyzer=1</query>
<query>select * from t_nullable where key_string2 in ('3') format Null</query>
<query>select * from t_nullable where key_string2 in ('3') format Null SETTINGS allow_experimental_analyzer=1</query>
<drop_query>drop table if exists t_nullable</drop_query>

</test>
</test>

0 comments on commit a29d4f5

Please sign in to comment.