diff --git a/dbms/src/Interpreters/ExpressionAnalyzer.cpp b/dbms/src/Interpreters/ExpressionAnalyzer.cpp index cfcd7989df5..4332fe30f64 100644 --- a/dbms/src/Interpreters/ExpressionAnalyzer.cpp +++ b/dbms/src/Interpreters/ExpressionAnalyzer.cpp @@ -961,18 +961,6 @@ void ExpressionAnalyzer::normalizeTreeImpl( if ((func_node = typeid_cast(ast.get()))) { - /** Is there a column in the table whose name fully matches the function entry? - * For example, in the table there is a column "domain(URL)", and we requested domain(URL). - */ - String function_string = func_node->getColumnName(); - auto it = findColumn(function_string); - if (columns.end() != it) - { - ast = std::make_shared(func_node->range, function_string); - current_asts.insert(ast.get()); - replaced = true; - } - /// `IN t` can be specified, where t is a table, which is equivalent to `IN (SELECT * FROM t)`. if (functionIsInOrGlobalInOperator(func_node->name)) if (ASTIdentifier * right = typeid_cast(func_node->arguments->children.at(1).get())) diff --git a/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.reference b/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.reference @@ -0,0 +1 @@ +1 diff --git a/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.sql b/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.sql new file mode 100644 index 00000000000..9c56eb5e5a8 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.sql @@ -0,0 +1 @@ +SELECT count() FROM (SELECT count() FROM numbers(10));