Added test for the case when Nullable condition is optimized to PREWHERE #1626

This commit is contained in:
Alexey Milovidov 2017-12-23 05:52:13 +03:00
parent bd14d22d22
commit e5a33e6332
2 changed files with 18 additions and 0 deletions

View File

@ -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;