From 2d2ccde1c0ccef746fa195a1c0d44b31bd137985 Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Tue, 16 Dec 2014 19:44:05 +0300 Subject: [PATCH] Add new functional tests for UNION ALL. [#METR-14099] --- .../0_stateless/00098_1_union_all.reference | 2 ++ .../queries/0_stateless/00098_1_union_all.sql | 1 + .../0_stateless/00098_2_union_all.reference | 2 ++ .../queries/0_stateless/00098_2_union_all.sql | 1 + .../0_stateless/00098_3_union_all.reference | 2 ++ .../queries/0_stateless/00098_3_union_all.sql | 2 ++ .../0_stateless/00098_4_union_all.reference | 3 +++ .../queries/0_stateless/00098_4_union_all.sql | 1 + .../0_stateless/00098_5_union_all.reference | 6 ++++++ .../queries/0_stateless/00098_5_union_all.sql | 15 +++++++++++++++ .../0_stateless/00098_6_union_all.reference | 3 +++ .../queries/0_stateless/00098_6_union_all.sql | 2 ++ 12 files changed, 40 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00098_1_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_1_union_all.sql create mode 100644 dbms/tests/queries/0_stateless/00098_2_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_2_union_all.sql create mode 100644 dbms/tests/queries/0_stateless/00098_3_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_3_union_all.sql create mode 100644 dbms/tests/queries/0_stateless/00098_4_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_4_union_all.sql create mode 100644 dbms/tests/queries/0_stateless/00098_5_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_5_union_all.sql create mode 100644 dbms/tests/queries/0_stateless/00098_6_union_all.reference create mode 100644 dbms/tests/queries/0_stateless/00098_6_union_all.sql 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; +