Better test

This commit is contained in:
kssenii 2021-04-23 12:57:34 +00:00
parent 7c3b074891
commit a927611fcf
2 changed files with 27 additions and 6 deletions

View File

@ -7,3 +7,9 @@ WORLD
HELLO PEOPLE
WORLD PEOPLE
1 1001
2 1002
1 501 1001
2 502 1002

View File

@ -1,15 +1,30 @@
DROP TABLE IF EXISTS test_null_as_default;
CREATE TABLE test_null_as_default (s String DEFAULT 'WORLD') ENGINE = Memory;
CREATE TABLE test_null_as_default (a String DEFAULT 'WORLD') ENGINE = Memory;
INSERT INTO test_null_as_default SELECT 'HELLO' UNION ALL SELECT NULL;
SELECT * FROM test_null_as_default ORDER BY s;
SELECT * FROM test_null_as_default ORDER BY a;
SELECT '';
INSERT INTO test_null_as_default SELECT NULL;
SELECT * FROM test_null_as_default ORDER BY s;
SELECT * FROM test_null_as_default ORDER BY a;
SELECT '';
REPLACE TABLE test_null_as_default (s String DEFAULT 'WORLD', ss String DEFAULT 'PEOPLE') ENGINE = Memory;
DROP TABLE IF EXISTS test_null_as_default;
CREATE TABLE test_null_as_default (a String DEFAULT 'WORLD', b String DEFAULT 'PEOPLE') ENGINE = Memory;
INSERT INTO test_null_as_default(s) SELECT 'HELLO' UNION ALL SELECT NULL;
SELECT * FROM test_null_as_default ORDER BY s;
INSERT INTO test_null_as_default(a) SELECT 'HELLO' UNION ALL SELECT NULL;
SELECT * FROM test_null_as_default ORDER BY a;
SELECT '';
DROP TABLE IF EXISTS test_null_as_default;
CREATE TABLE test_null_as_default (a Int8, b Int64 DEFAULT a + 1000) ENGINE = Memory;
INSERT INTO test_null_as_default SELECT 1, NULL UNION ALL SELECT 2, NULL;
SELECT * FROM test_null_as_default ORDER BY a;
SELECT '';
DROP TABLE IF EXISTS test_null_as_default;
CREATE TABLE test_null_as_default (a Int8, b Int64 DEFAULT c - 500, c Int32 DEFAULT a + 1000) ENGINE = Memory;
INSERT INTO test_null_as_default(a, c) SELECT 1, NULL UNION ALL SELECT 2, NULL;
SELECT * FROM test_null_as_default ORDER BY a;