mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #57123 from ClickHouse/vdimir/fix_logical_error_analyzer_or_optimize
Analyzer: Fix logical error in LogicalExpressionOptimizerVisitor
This commit is contained in:
commit
bbc577646f
@ -439,7 +439,7 @@ private:
|
||||
}
|
||||
|
||||
/// otherwise add a stub 0 to make OR correct
|
||||
or_operands.push_back(std::make_shared<ConstantNode>(static_cast<UInt8>(0)));
|
||||
or_operands.push_back(std::make_shared<ConstantNode>(static_cast<UInt8>(0), function_node.getResultType()));
|
||||
}
|
||||
|
||||
auto or_function_resolver = FunctionFactory::instance().get("or", getContext());
|
||||
|
@ -87,3 +87,4 @@ QUERY id: 0
|
||||
LIST id: 6, nodes: 2
|
||||
COLUMN id: 7, column_name: a, result_type: Int32, source_id: 3
|
||||
CONSTANT id: 8, constant_value: UInt64_2, constant_value_type: UInt8
|
||||
1
|
||||
|
@ -24,3 +24,5 @@ EXPLAIN QUERY TREE SELECT * FROM 02668_logical_optimizer WHERE a = 3 AND b = 'an
|
||||
|
||||
SELECT * FROM 02668_logical_optimizer WHERE a = 2 AND 2 = a;
|
||||
EXPLAIN QUERY TREE SELECT * FROM 02668_logical_optimizer WHERE a = 2 AND 2 = a;
|
||||
|
||||
SELECT (k = 3) OR ( (k = 1) OR (k = 2) OR ( (NULL OR 1) = k ) ) FROM ( SELECT materialize(1) AS k );
|
||||
|
Loading…
Reference in New Issue
Block a user