diff --git a/dbms/tests/queries/0_stateless/00098_1_union_all.reference b/dbms/tests/queries/0_stateless/00098_1_union_all.reference new file mode 100644 index 00000000000..1191247b6d9 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_1_union_all.reference @@ -0,0 +1,2 @@ +1 +2 diff --git a/dbms/tests/queries/0_stateless/00098_1_union_all.sql b/dbms/tests/queries/0_stateless/00098_1_union_all.sql new file mode 100644 index 00000000000..6114f5cfaef --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_1_union_all.sql @@ -0,0 +1 @@ +SELECT 1 UNION ALL SELECT 2; diff --git a/dbms/tests/queries/0_stateless/00098_2_union_all.reference b/dbms/tests/queries/0_stateless/00098_2_union_all.reference new file mode 100644 index 00000000000..1191247b6d9 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_2_union_all.reference @@ -0,0 +1,2 @@ +1 +2 diff --git a/dbms/tests/queries/0_stateless/00098_2_union_all.sql b/dbms/tests/queries/0_stateless/00098_2_union_all.sql new file mode 100644 index 00000000000..88f24d7f00b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_2_union_all.sql @@ -0,0 +1 @@ +SELECT 1 UNION ALL SELECT 2; diff --git a/dbms/tests/queries/0_stateless/00098_3_union_all.reference b/dbms/tests/queries/0_stateless/00098_3_union_all.reference new file mode 100644 index 00000000000..1191247b6d9 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_3_union_all.reference @@ -0,0 +1,2 @@ +1 +2 diff --git a/dbms/tests/queries/0_stateless/00098_3_union_all.sql b/dbms/tests/queries/0_stateless/00098_3_union_all.sql new file mode 100644 index 00000000000..776460cd183 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_3_union_all.sql @@ -0,0 +1,2 @@ +SELECT 1 UNION /*comment*/ ALL SELECT 2; + diff --git a/dbms/tests/queries/0_stateless/00098_4_union_all.reference b/dbms/tests/queries/0_stateless/00098_4_union_all.reference new file mode 100644 index 00000000000..9355227d376 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_4_union_all.reference @@ -0,0 +1,3 @@ +1 2 +3 4 +5 6 diff --git a/dbms/tests/queries/0_stateless/00098_4_union_all.sql b/dbms/tests/queries/0_stateless/00098_4_union_all.sql new file mode 100644 index 00000000000..711b0c3b032 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_4_union_all.sql @@ -0,0 +1 @@ +SELECT 1,2 UNION ALL SELECT 3,4 UNION ALL SELECT 5,6; diff --git a/dbms/tests/queries/0_stateless/00098_5_union_all.reference b/dbms/tests/queries/0_stateless/00098_5_union_all.reference new file mode 100644 index 00000000000..349887b702e --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_5_union_all.reference @@ -0,0 +1,6 @@ +Alice 1000 +Alice 2000 +Bob 2000 +Bob 2000 +Carol 5000 +Dennis 35000 diff --git a/dbms/tests/queries/0_stateless/00098_5_union_all.sql b/dbms/tests/queries/0_stateless/00098_5_union_all.sql new file mode 100644 index 00000000000..2def5c03a8f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_5_union_all.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS data2013; +DROP TABLE IF EXISTS data2014; + +CREATE TABLE data2013 (name String, value UInt32) ENGINE = Memory; +CREATE TABLE data2014 (name String, value UInt32) ENGINE = Memory; + +INSERT INTO data2013(name,value) VALUES('Alice', 1000); +INSERT INTO data2013(name,value) VALUES('Bob', 2000); +INSERT INTO data2013(name,value) VALUES('Carol', 5000); + +INSERT INTO data2014(name,value) VALUES('Alice', 2000); +INSERT INTO data2014(name,value) VALUES('Bob', 2000); +INSERT INTO data2014(name,value) VALUES('Dennis', 35000); + +SELECT nn,vv FROM (SELECT name AS nn, value AS vv FROM data2013 UNION ALL SELECT name AS nn, value AS vv FROM data2014) ORDER BY nn ASC; diff --git a/dbms/tests/queries/0_stateless/00098_6_union_all.reference b/dbms/tests/queries/0_stateless/00098_6_union_all.reference new file mode 100644 index 00000000000..01e79c32a8c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_6_union_all.reference @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/dbms/tests/queries/0_stateless/00098_6_union_all.sql b/dbms/tests/queries/0_stateless/00098_6_union_all.sql new file mode 100644 index 00000000000..57e9b3aacc0 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00098_6_union_all.sql @@ -0,0 +1,2 @@ +SELECT X FROM (SELECT 3 AS X UNION ALL SELECT 2 AS X UNION ALL SELECT 1 AS X) ORDER BY X ASC; +