ClickHouse/tests/queries/0_stateless/02312_is_not_null_prewhere.sql

22 lines
519 B
MySQL
Raw Normal View History

2022-06-02 09:42:29 +00:00
DROP TABLE IF EXISTS bug_36995;
CREATE TABLE bug_36995(
`time` DateTime,
`product` String)
ENGINE = MergeTree
ORDER BY time AS
SELECT '2022-01-01 00:00:00','1';
SELECT * FROM bug_36995
WHERE (time IS NOT NULL) AND (product IN (SELECT '1'))
SETTINGS optimize_move_to_prewhere = 1;
SELECT * FROM bug_36995
WHERE (time IS NOT NULL) AND (product IN (SELECT '1'))
SETTINGS optimize_move_to_prewhere = 0;
SELECT * FROM bug_36995
PREWHERE (time IS NOT NULL) WHERE (product IN (SELECT '1'));
DROP TABLE bug_36995;