From 6efb40c48be6da2339ff90f98d22574b5da7ffbb Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Fri, 10 Jul 2015 17:42:30 +0300 Subject: [PATCH] Merge --- dbms/src/Interpreters/ExpressionAnalyzer.cpp | 2 +- dbms/tests/queries/0_stateless/00098_l_union_all.reference | 6 ++++++ dbms/tests/queries/0_stateless/00098_l_union_all.sql | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 dbms/tests/queries/0_stateless/00098_l_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_l_union_all.sql diff --git a/dbms/src/Interpreters/ExpressionAnalyzer.cpp b/dbms/src/Interpreters/ExpressionAnalyzer.cpp index 60d7b502fb0..bc7f01eaff3 100644 --- a/dbms/src/Interpreters/ExpressionAnalyzer.cpp +++ b/dbms/src/Interpreters/ExpressionAnalyzer.cpp @@ -1965,7 +1965,7 @@ void ExpressionAnalyzer::collectJoinedColumns(NameSet & joined_columns, NamesAnd else if (typeid_cast(node.table.get())) { const auto & subquery = node.table->children.at(0); - nested_result_sample = InterpreterSelectQuery(subquery, context, QueryProcessingStage::Complete, subquery_depth + 1).getSampleBlock(); + nested_result_sample = InterpreterSelectQuery(subquery, context, QueryProcessingStage::Complete, subquery_depth + 1, nullptr, false).getSampleBlock(); } auto & keys = typeid_cast(*node.using_expr_list); diff --git a/dbms/tests/queries/0_stateless/00098_l_union_all.reference b/dbms/tests/queries/0_stateless/00098_l_union_all.reference new file mode 100644 index 00000000000..e861860259e --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_l_union_all.reference @@ -0,0 +1,6 @@ +1 2 3 4 +2 3 4 5 +1 2 3 4 +2 3 4 5 +1 2 3 4 +2 3 4 5 diff --git a/dbms/tests/queries/0_stateless/00098_l_union_all.sql b/dbms/tests/queries/0_stateless/00098_l_union_all.sql new file mode 100644 index 00000000000..e12e17c2c5a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_l_union_all.sql @@ -0,0 +1,3 @@ +SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ANY inner JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING (a) ORDER BY a,b,c,d ASC; +SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ALL left JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING (a) ORDER BY a,b,c,d ASC; +SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ALL left JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING a,b ORDER BY a,b,c,d ASC;