Allow tests to execute in random order #3926

This commit is contained in:
Alexey Milovidov 2018-12-27 04:09:27 +03:00
parent 4c35a73a74
commit d2b7a847c7
8 changed files with 118 additions and 0 deletions

View File

@ -29,3 +29,6 @@ UNION ALL
SELECT value AS val, value, name FROM data2014 WHERE name = 'Alice')
ORDER BY val ASC;
DROP TABLE data2013;
DROP TABLE data2014;
DROP TABLE data2015;

View File

@ -1,6 +1,22 @@
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 val FROM
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
UNION ALL
SELECT value AS val FROM data2014 WHERE name = 'Alice')
ORDER BY val ASC;
DROP TABLE data2013;
DROP TABLE data2014;

View File

@ -1,5 +1,22 @@
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 val FROM
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
UNION /*comment*/ ALL
SELECT value AS val FROM data2014 WHERE name = 'Alice')
ORDER BY val ASC;
DROP TABLE data2013;
DROP TABLE data2014;

View File

@ -1,3 +1,17 @@
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 val FROM
(SELECT value AS val FROM data2013 WHERE name = 'Alice'
UNION ALL
@ -5,3 +19,6 @@ SELECT value AS val FROM data2014 WHERE name = 'Alice'
UNION ALL
SELECT value AS val FROM data2014 WHERE name = 'Dennis')
ORDER BY val ASC;
DROP TABLE data2013;
DROP TABLE data2014;

View File

@ -1 +1,18 @@
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,vv ASC;
DROP TABLE data2013;
DROP TABLE data2014;

View File

@ -1 +1,17 @@
DROP TABLE IF EXISTS data2013;
DROP TABLE IF EXISTS data2015;
CREATE TABLE data2013 (name String, value UInt32) ENGINE = Memory;
CREATE TABLE data2015 (data_name String, data_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 data2015(data_name, data_value) VALUES('Foo', 42);
INSERT INTO data2015(data_name, data_value) VALUES('Bar', 1);
SELECT name FROM (SELECT name FROM data2013 UNION ALL SELECT data_name FROM data2015) ORDER BY name ASC;
DROP TABLE data2013;
DROP TABLE data2015;

View File

@ -1 +1,17 @@
DROP TABLE IF EXISTS data2013;
DROP TABLE IF EXISTS data2015;
CREATE TABLE data2013 (name String, value UInt32) ENGINE = Memory;
CREATE TABLE data2015 (data_name String, data_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 data2015(data_name, data_value) VALUES('Foo', 42);
INSERT INTO data2015(data_name, data_value) VALUES('Bar', 1);
SELECT X FROM (SELECT name AS X FROM data2013 UNION ALL SELECT data_name FROM data2015) ORDER BY X ASC;
DROP TABLE data2013;
DROP TABLE data2015;

View File

@ -1 +1,17 @@
DROP TABLE IF EXISTS data2013;
DROP TABLE IF EXISTS data2015;
CREATE TABLE data2013 (name String, value UInt32) ENGINE = Memory;
CREATE TABLE data2015 (data_name String, data_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 data2015(data_name, data_value) VALUES('Foo', 42);
INSERT INTO data2015(data_name, data_value) VALUES('Bar', 1);
SELECT name FROM (SELECT name FROM data2013 UNION ALL SELECT data_name AS name FROM data2015) ORDER BY name ASC;
DROP TABLE data2013;
DROP TABLE data2015;