mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 17:32:32 +00:00
OR to IN rewrite issue in functions
This commit is contained in:
parent
e8c8014d4f
commit
5e3bc07a25
@ -357,11 +357,10 @@ void LogicalExpressionsOptimizer::fixBrokenOrExpressions()
|
||||
|
||||
for (auto & parent : parents)
|
||||
{
|
||||
parent->children.push_back(operands[0]);
|
||||
auto first_erased = std::remove_if(parent->children.begin(), parent->children.end(),
|
||||
[or_function](const ASTPtr & ptr) { return ptr.get() == or_function; });
|
||||
|
||||
parent->children.erase(first_erased, parent->children.end());
|
||||
// The order of children matters if or is children of some function, e.g. minus
|
||||
std::replace_if(parent->children.begin(), parent->children.end(),
|
||||
[or_function](const ASTPtr & ptr) { return ptr.get() == or_function; },
|
||||
operands[0] );
|
||||
}
|
||||
|
||||
/// If the OR node was the root of the WHERE, PREWHERE, or HAVING expression, then update this root.
|
||||
|
Loading…
Reference in New Issue
Block a user