mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Fix unused with column
This commit is contained in:
parent
3ca0bdc848
commit
0b74d146ef
@ -123,8 +123,12 @@ void RequiredSourceColumnsMatcher::visit(const ASTSelectQuery & select, const AS
|
||||
|
||||
std::vector<ASTPtr *> out;
|
||||
for (const auto & node : select.children)
|
||||
if (node != select.select())
|
||||
{
|
||||
// We should not go into WITH statement because all needed aliases are already expanded to
|
||||
// the right place after normalization. And it might contain unused unknown columns.
|
||||
if (node != select.select() && node != select.with())
|
||||
Visitor(data).visit(node);
|
||||
}
|
||||
|
||||
/// revisit select_expression_list (with children) when all the aliases are set
|
||||
Visitor(data).visit(select.select());
|
||||
|
Loading…
Reference in New Issue
Block a user