diff --git a/tests/queries/0_stateless/01846_null_as_default_for_insert_select.reference b/tests/queries/0_stateless/01846_null_as_default_for_insert_select.reference index caddae74946..a50af17a63f 100644 --- a/tests/queries/0_stateless/01846_null_as_default_for_insert_select.reference +++ b/tests/queries/0_stateless/01846_null_as_default_for_insert_select.reference @@ -7,3 +7,9 @@ WORLD HELLO PEOPLE WORLD PEOPLE + +1 1001 +2 1002 + +1 501 1001 +2 502 1002 diff --git a/tests/queries/0_stateless/01846_null_as_default_for_insert_select.sql b/tests/queries/0_stateless/01846_null_as_default_for_insert_select.sql index ee12c0b8442..d6f3b8a2136 100644 --- a/tests/queries/0_stateless/01846_null_as_default_for_insert_select.sql +++ b/tests/queries/0_stateless/01846_null_as_default_for_insert_select.sql @@ -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;