QueryNormalizer only checks stack size

This commit is contained in:
vdimir 2023-10-16 10:33:04 +00:00
parent ba5cd016dd
commit d7c77420b6
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 1 additions and 3 deletions

View File

@ -120,7 +120,6 @@ void QueryNormalizer::visit(ASTIdentifier & node, ASTPtr & ast, Data & data)
/// In a construct like "a AS b", where a is an alias, you must set alias b to the result of substituting alias a.
/// Check size of the alias before cloning too large alias AST
alias_node->checkSize(data.settings.max_expanded_ast_elements);
current_asts.insert(alias_node.get());
ast = alias_node->clone();
ast->setAlias(node_alias);
@ -139,7 +138,6 @@ void QueryNormalizer::visit(ASTIdentifier & node, ASTPtr & ast, Data & data)
/// Check size of the alias before cloning too large alias AST
alias_node->checkSize(data.settings.max_expanded_ast_elements);
auto alias_name = ast->getAliasOrColumnName();
current_asts.insert(alias_node.get());
ast = alias_node->clone();
ast->setAlias(alias_name);

View File

@ -6,7 +6,7 @@ SELECT
val + 1 as prev,
val + prev as val
FROM ( SELECT 1 as val )
; -- { serverError CYCLIC_ALIASES }
; -- { serverError CYCLIC_ALIASES, TOO_DEEP_RECURSION }
SELECT