This commit is contained in:
Alexey Arno 2015-07-10 17:42:30 +03:00
parent 8aa96f3f79
commit 6efb40c48b
3 changed files with 10 additions and 1 deletions

View File

@ -1965,7 +1965,7 @@ void ExpressionAnalyzer::collectJoinedColumns(NameSet & joined_columns, NamesAnd
else if (typeid_cast<const ASTSubquery *>(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<ASTExpressionList &>(*node.using_expr_list);

View File

@ -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

View File

@ -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;