mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 18:45:20 +00:00
Fix normalization of UNION inside DESCRIBE query
This commit is contained in:
parent
77ea9a11cd
commit
3a22e37691
@ -2286,9 +2286,9 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromJoin(const IdentifierLoo
|
||||
else
|
||||
{
|
||||
throw Exception(ErrorCodes::AMBIGUOUS_IDENTIFIER,
|
||||
"JOIN {} ambiguous identifier {}. In scope {}",
|
||||
"JOIN {} ambiguous identifier '{}'. In scope {}",
|
||||
table_expression_node->formatASTForErrorMessage(),
|
||||
identifier_lookup.dump(),
|
||||
identifier_lookup.identifier.getFullName(),
|
||||
scope.scope_node->formatASTForErrorMessage());
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ void NormalizeSelectWithUnionQueryMatcher::visit(ASTSelectWithUnionQuery & ast,
|
||||
SelectUnionModesSet current_set_of_modes;
|
||||
bool distinct_found = false;
|
||||
|
||||
for (ssize_t i = union_modes.size() - 1; i >= 0; --i)
|
||||
for (Int64 i = union_modes.size() - 1; i >= 0; --i)
|
||||
{
|
||||
current_set_of_modes.insert(union_modes[i]);
|
||||
if (const auto * union_ast = typeid_cast<const ASTSelectWithUnionQuery *>(select_list[i + 1].get()))
|
||||
|
@ -33,7 +33,8 @@ bool ParserDescribeTableQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & ex
|
||||
if (!ParserTableExpression().parse(pos, table_expression, expected))
|
||||
return false;
|
||||
|
||||
query->table_expression = table_expression;
|
||||
query->children.push_back(std::move(table_expression));
|
||||
query->table_expression = query->children.back();
|
||||
|
||||
node = query;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user