mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
GroupingFunctionsResolvePass crash fix
This commit is contained in:
parent
387f035560
commit
caaff8f387
@ -149,8 +149,9 @@ void resolveGroupingFunctions(QueryTreeNodePtr & query_node, ContextPtr context)
|
|||||||
/// It is expected by execution layer that if there are only 1 grouping set it will be removed
|
/// It is expected by execution layer that if there are only 1 grouping set it will be removed
|
||||||
if (query_node_typed.isGroupByWithGroupingSets() && query_node_typed.getGroupBy().getNodes().size() == 1)
|
if (query_node_typed.isGroupByWithGroupingSets() && query_node_typed.getGroupBy().getNodes().size() == 1)
|
||||||
{
|
{
|
||||||
auto & grouping_set_list_node = query_node_typed.getGroupBy().getNodes().front()->as<ListNode &>();
|
auto grouping_set_list_node = query_node_typed.getGroupBy().getNodes().front();
|
||||||
query_node_typed.getGroupBy().getNodes() = std::move(grouping_set_list_node.getNodes());
|
auto & grouping_set_list_node_typed = grouping_set_list_node->as<ListNode &>();
|
||||||
|
query_node_typed.getGroupBy().getNodes() = std::move(grouping_set_list_node_typed.getNodes());
|
||||||
query_node_typed.setIsGroupByWithGroupingSets(false);
|
query_node_typed.setIsGroupByWithGroupingSets(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1804,7 +1804,7 @@ void QueryAnalyzer::evaluateScalarSubqueryIfNeeded(QueryTreeNodePtr & node, Iden
|
|||||||
subquery_context->setSettings(subquery_settings);
|
subquery_context->setSettings(subquery_settings);
|
||||||
|
|
||||||
auto options = SelectQueryOptions(QueryProcessingStage::Complete, scope.subquery_depth, true /*is_subquery*/);
|
auto options = SelectQueryOptions(QueryProcessingStage::Complete, scope.subquery_depth, true /*is_subquery*/);
|
||||||
auto interpreter = std::make_unique<InterpreterSelectQueryAnalyzer>(node, subquery_context, options);
|
auto interpreter = std::make_unique<InterpreterSelectQueryAnalyzer>(node->toAST(), subquery_context, options);
|
||||||
|
|
||||||
auto io = interpreter->execute();
|
auto io = interpreter->execute();
|
||||||
|
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
\N
|
||||||
|
2
|
@ -0,0 +1,5 @@
|
|||||||
|
SET allow_experimental_analyzer = 1;
|
||||||
|
|
||||||
|
WITH pow(NULL, 256) AS four SELECT NULL AS two GROUP BY GROUPING SETS ((pow(two, 65536)));
|
||||||
|
|
||||||
|
WITH (SELECT pow(two, 1) GROUP BY GROUPING SETS ((pow(1, 9)))) AS four SELECT 2 AS two GROUP BY pow(1, two);
|
Loading…
Reference in New Issue
Block a user