From 6b82159a296fa493c33d8a7fc7224e3bb6613a20 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Fri, 13 Dec 2024 12:20:28 +0000 Subject: [PATCH] Fixinmore tests. --- src/Planner/PlannerJoinTree.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Planner/PlannerJoinTree.cpp b/src/Planner/PlannerJoinTree.cpp index 573b593103e..746bdbd3ba1 100644 --- a/src/Planner/PlannerJoinTree.cpp +++ b/src/Planner/PlannerJoinTree.cpp @@ -2092,10 +2092,12 @@ JoinTreeQueryPlan buildJoinTreeQueryPlan(const QueryTreeNodePtr & query_node, { const auto & table_expression = table_expressions_stack[i]; auto table_expression_type = table_expression->getNodeType(); - if (table_expression_type == QueryTreeNodeType::JOIN || - table_expression_type == QueryTreeNodeType::CROSS_JOIN) + if (table_expression_type == QueryTreeNodeType::ARRAY_JOIN) continue; + if (table_expression_type == QueryTreeNodeType::CROSS_JOIN) + joins_count += table_expression->as().getTableExpressions().size() - 1; + if (table_expression_type == QueryTreeNodeType::JOIN) { ++joins_count; @@ -2118,7 +2120,9 @@ JoinTreeQueryPlan buildJoinTreeQueryPlan(const QueryTreeNodePtr & query_node, QueryTreeNodePtr parent_join_tree = join_tree_node; for (const auto & node : table_expressions_stack) { - if (node->getNodeType() == QueryTreeNodeType::JOIN || node->getNodeType() == QueryTreeNodeType::ARRAY_JOIN) + if (node->getNodeType() == QueryTreeNodeType::JOIN || + node->getNodeType() == QueryTreeNodeType::CROSS_JOIN || + node->getNodeType() == QueryTreeNodeType::ARRAY_JOIN) { parent_join_tree = node; break;