ClickHouse/tests/queries/0_stateless/01913_join_push_down_bug.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
510 B
MySQL
Raw Normal View History

2021-06-16 17:51:16 +00:00
DROP TABLE IF EXISTS test;
CREATE TABLE test
(
`t` UInt8,
`flag` UInt8,
`id` UInt8
)
ENGINE = MergeTree
PARTITION BY t
ORDER BY (t, id)
SETTINGS index_granularity = 8192;
INSERT INTO test VALUES (1,0,1),(1,0,2),(1,0,3),(1,0,4),(1,0,5),(1,0,6),(1,1,7),(0,0,7);
set query_plan_filter_push_down = true;
2021-06-16 17:51:16 +00:00
SELECT id, flag FROM test t1
INNER JOIN (SELECT DISTINCT id FROM test) AS t2 ON t1.id = t2.id
WHERE flag = 0 and t = 1 AND id NOT IN (SELECT 1 WHERE 0)
ORDER BY id;
2021-06-16 17:51:16 +00:00
DROP TABLE IF EXISTS test;