Skip to content

Commit

Permalink
Revert "Merge pull request ClickHouse#27531 from abel-cheng/with-cons…
Browse files Browse the repository at this point in the history
…tants"

This reverts commit a020fe3, reversing
changes made to 8c06abe.

Reverted to fix ClickHouse#37812 missing columns in case of using constants in CTE
  • Loading branch information
Enmk committed Aug 10, 2022
1 parent eef3761 commit 569eb82
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 55 deletions.
3 changes: 0 additions & 3 deletions src/Interpreters/QueryNormalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ void QueryNormalizer::visit(ASTPtr & ast, Data & data)
visit(*node_select, ast, data);
else if (auto * node_param = ast->as<ASTQueryParameter>())
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 (ast.get() != initial_ast.get())
Expand Down
11 changes: 0 additions & 11 deletions src/Interpreters/RequiredSourceColumnsVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ void RequiredSourceColumnsMatcher::visit(const ASTSelectQuery & select, const AS
data.addColumnAliasIfAny(*node);
}

if (const auto & with = select.with())
{
for (auto & node : with->children)
{
if (const auto * identifier = node->as<ASTIdentifier>())
data.addColumnIdentifier(*identifier);
else
data.addColumnAliasIfAny(*node);
}
}

std::vector<ASTPtr *> out;
for (const auto & node : select.children)
{
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 569eb82

Please sign in to comment.