diff --git a/dbms/tests/queries/0_stateless/00543_null_and_prewhere.reference b/dbms/tests/queries/0_stateless/00543_null_and_prewhere.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00543_null_and_prewhere.reference @@ -0,0 +1 @@ +1 diff --git a/dbms/tests/queries/0_stateless/00543_null_and_prewhere.sql b/dbms/tests/queries/0_stateless/00543_null_and_prewhere.sql new file mode 100644 index 00000000000..063280085c3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00543_null_and_prewhere.sql @@ -0,0 +1,17 @@ +CREATE TABLE test.test +( + dt Date, + id UInt32, + val Nullable(UInt32) +) +ENGINE = MergeTree(dt, id, 8192); + +insert into test.test (dt, id, val) values ('2017-01-01', 1, 10); +insert into test.test (dt, id, val) values ('2017-01-01', 1, null); +insert into test.test (dt, id, val) values ('2017-01-01', 1, 0); + +SELECT count() +FROM test.test +WHERE val = 0; + +DROP TABLE IF EXISTS test.test;