Add new functional tests for UNION ALL. [#METR-14099]

This commit is contained in:
Alexey Arno 2014-12-16 19:44:05 +03:00
parent d29f019981
commit 2d2ccde1c0
12 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,2 @@
1
2

View File

@ -0,0 +1 @@
SELECT 1 UNION ALL SELECT 2;

View File

@ -0,0 +1,2 @@
1
2

View File

@ -0,0 +1 @@
SELECT 1 UNION ALL SELECT 2;

View File

@ -0,0 +1,2 @@
1
2

View File

@ -0,0 +1,2 @@
SELECT 1 UNION /*comment*/ ALL SELECT 2;

View File

@ -0,0 +1,3 @@
1 2
3 4
5 6

View File

@ -0,0 +1 @@
SELECT 1,2 UNION ALL SELECT 3,4 UNION ALL SELECT 5,6;

View File

@ -0,0 +1,6 @@
Alice 1000
Alice 2000
Bob 2000
Bob 2000
Carol 5000
Dennis 35000

View File

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

View File

@ -0,0 +1,3 @@
1
2
3

View File

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