mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
RewriteArrayExistsFunctionVisitor: Assert proper child on join expression
This commit is contained in:
parent
b4a3f6d370
commit
35a0d08a32
@ -20,20 +20,20 @@ void RewriteArrayExistsFunctionMatcher::visit(ASTPtr & ast, Data & data)
|
|||||||
if (join->using_expression_list)
|
if (join->using_expression_list)
|
||||||
{
|
{
|
||||||
auto * it = std::find(join->children.begin(), join->children.end(), join->using_expression_list);
|
auto * it = std::find(join->children.begin(), join->children.end(), join->using_expression_list);
|
||||||
|
if (it == join->children.end())
|
||||||
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Could not find join->using_expression_list in '{}'", join->formatForLogging());
|
||||||
|
|
||||||
visit(join->using_expression_list, data);
|
visit(join->using_expression_list, data);
|
||||||
|
|
||||||
if (it && *it != join->using_expression_list)
|
|
||||||
*it = join->using_expression_list;
|
*it = join->using_expression_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (join->on_expression)
|
if (join->on_expression)
|
||||||
{
|
{
|
||||||
auto * it = std::find(join->children.begin(), join->children.end(), join->on_expression);
|
auto * it = std::find(join->children.begin(), join->children.end(), join->on_expression);
|
||||||
|
if (it == join->children.end())
|
||||||
|
throw Exception(ErrorCodes::LOGICAL_ERROR, "Could not find join->on_expression in '{}'", join->formatForLogging());
|
||||||
|
|
||||||
visit(join->on_expression, data);
|
visit(join->on_expression, data);
|
||||||
|
|
||||||
if (it && *it != join->on_expression)
|
|
||||||
*it = join->on_expression;
|
*it = join->on_expression;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user