mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Better test
This commit is contained in:
parent
7c3b074891
commit
a927611fcf
@ -7,3 +7,9 @@ WORLD
|
||||
|
||||
HELLO PEOPLE
|
||||
WORLD PEOPLE
|
||||
|
||||
1 1001
|
||||
2 1002
|
||||
|
||||
1 501 1001
|
||||
2 502 1002
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user