mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Replace parameters in ASTFunctions with alias.
This commit is contained in:
parent
476b066668
commit
ec0ee2cecf
@ -256,6 +256,9 @@ void QueryNormalizer::visit(ASTPtr & ast, Data & data)
|
|||||||
visit(*node_select, ast, data);
|
visit(*node_select, ast, data);
|
||||||
else if (auto * node_param = ast->as<ASTQueryParameter>())
|
else if (auto * node_param = ast->as<ASTQueryParameter>())
|
||||||
throw Exception("Query parameter " + backQuote(node_param->name) + " was not set", ErrorCodes::UNKNOWN_QUERY_PARAMETER);
|
throw Exception("Query parameter " + backQuote(node_param->name) + " was not set", ErrorCodes::UNKNOWN_QUERY_PARAMETER);
|
||||||
|
else if (auto * node_function = ast->as<ASTFunction>())
|
||||||
|
if (node_function->parameters)
|
||||||
|
visit(node_function->parameters, data);
|
||||||
|
|
||||||
/// If we replace the root of the subtree, we will be called again for the new root, in case the alias is replaced by an alias.
|
/// If we replace the root of the subtree, we will be called again for the new root, in case the alias is replaced by an alias.
|
||||||
if (ast.get() != initial_ast.get())
|
if (ast.get() != initial_ast.get())
|
||||||
|
Loading…
Reference in New Issue
Block a user