diff --git a/dbms/src/Interpreters/ExpressionAnalyzer.cpp b/dbms/src/Interpreters/ExpressionAnalyzer.cpp index cfcd7989df53f99dd7ed90ad9ae69d7470dfff07..4332fe30f64610644436be973bbd0dfde0152cd8 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 0000000000000000000000000000000000000000..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d --- /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 0000000000000000000000000000000000000000..9c56eb5e5a80a9b0fac8e1859c489839d5966945 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00582_not_aliasing_functions.sql @@ -0,0 +1 @@ +SELECT count() FROM (SELECT count() FROM numbers(10));