mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Better fix
This commit is contained in:
parent
1002148886
commit
10747fd7c3
@ -34,7 +34,6 @@ void MarkTableIdentifiersMatcher::visit(const ASTFunction & func, ASTPtr & ptr,
|
||||
auto opt_name = tryGetIdentifierName(ast);
|
||||
if (opt_name && !data.aliases.count(*opt_name) && ast->as<ASTIdentifier>())
|
||||
{
|
||||
ptr = func.clone();
|
||||
ptr->as<ASTFunction>()->arguments->children[1] = ast->as<ASTIdentifier>()->createTable();
|
||||
assert(ptr->as<ASTFunction>()->arguments->children[1]);
|
||||
}
|
||||
@ -46,11 +45,11 @@ void MarkTableIdentifiersMatcher::visit(const ASTFunction & func, ASTPtr & ptr,
|
||||
{
|
||||
if (func.arguments->children.empty())
|
||||
return;
|
||||
|
||||
auto ast = func.arguments->children.at(0);
|
||||
auto opt_name = tryGetIdentifierName(ast);
|
||||
if (opt_name && !data.aliases.count(*opt_name) && ast->as<ASTIdentifier>())
|
||||
{
|
||||
ptr = func.clone();
|
||||
ptr->as<ASTFunction>()->arguments->children[0] = ast->as<ASTIdentifier>()->createTable();
|
||||
assert(ptr->as<ASTFunction>()->arguments->children[0]);
|
||||
}
|
||||
|
@ -739,13 +739,13 @@ void TreeRewriter::normalize(ASTPtr & query, Aliases & aliases, const Settings &
|
||||
CustomizeAggregateFunctionsOrNullVisitor(data_or_null).visit(query);
|
||||
}
|
||||
|
||||
/// Creates a dictionary `aliases`: alias -> ASTPtr
|
||||
QueryAliasesVisitor(aliases).visit(query);
|
||||
|
||||
/// Mark table ASTIdentifiers with not a column marker
|
||||
MarkTableIdentifiersVisitor::Data identifiers_data{aliases};
|
||||
MarkTableIdentifiersVisitor(identifiers_data).visit(query);
|
||||
|
||||
/// Creates a dictionary `aliases`: alias -> ASTPtr
|
||||
QueryAliasesVisitor(aliases).visit(query);
|
||||
|
||||
/// Common subexpression elimination. Rewrite rules.
|
||||
QueryNormalizer::Data normalizer_data(aliases, settings);
|
||||
QueryNormalizer(normalizer_data).visit(query);
|
||||
|
Loading…
Reference in New Issue
Block a user