mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 04:52:10 +00:00
fix error for in Null
This commit is contained in:
parent
862abf2f6e
commit
45bbef689a
@ -32,9 +32,12 @@ public:
|
||||
auto * constant_node = args[1]->as<ConstantNode>();
|
||||
if (!column_node || !constant_node)
|
||||
return ;
|
||||
// IN multiple values is not supported
|
||||
if (constant_node->getValue().getType() == Field::Types::Which::Tuple)
|
||||
return;
|
||||
|
||||
return ;
|
||||
// x IN null not equivalent to x = null
|
||||
if (constant_node->hasSourceExpression() || constant_node->getValue().isNull())
|
||||
return ;
|
||||
auto equal_resolver = createInternalFunctionEqualOverloadResolver();
|
||||
auto equal = std::make_shared<FunctionNode>("equals");
|
||||
QueryTreeNodes arguments{column_node->clone(), constant_node->clone()};
|
||||
|
@ -1,5 +1,11 @@
|
||||
a 1
|
||||
-------------------
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
-------------------
|
||||
QUERY id: 0
|
||||
PROJECTION COLUMNS
|
||||
x String
|
||||
|
@ -5,6 +5,8 @@ INSERT INTO test VALUES ('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5);
|
||||
|
||||
select * from test where x in ('a') SETTINGS allow_experimental_analyzer = 1;
|
||||
select '-------------------';
|
||||
select x in Null from test;
|
||||
select '-------------------';
|
||||
explain query tree select * from test where x in ('a') SETTINGS allow_experimental_analyzer = 1;
|
||||
select '-------------------';
|
||||
explain query tree select * from test where x in ('a','b') SETTINGS allow_experimental_analyzer = 1;
|
||||
explain query tree select * from test where x in ('a','b') SETTINGS allow_experimental_analyzer = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user