diff --git a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference index 0d430f5263d..351e10ca3ff 100644 --- a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference +++ b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference @@ -34,3 +34,4 @@ max(key) from tab any left join (select key, arrayJoin(n.x) as val from tab) usi 1 max(key) from tab any left join (select key, arrayJoin(n.x) as val from tab) using key where (key, val) in ((1, 1), (2, 2)) 2 +1 diff --git a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql index 3783bcb3f2f..54a38c5fcca 100644 --- a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql +++ b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql @@ -38,3 +38,8 @@ select 'max(key) from tab any left join (select key, arrayJoin(n.x) as val from select max(key) from test.tab any left join (select key, arrayJoin(n.x) as val from test.tab) using key where (key, val) in (1, 1); select 'max(key) from tab any left join (select key, arrayJoin(n.x) as val from tab) using key where (key, val) in ((1, 1), (2, 2))'; select max(key) from test.tab any left join (select key, arrayJoin(n.x) as val from test.tab) using key where (key, val) in ((1, 1), (2, 2)); + +drop table if exists test.tab; +CREATE TABLE test.tab (key1 Int32, id1 Int64, c1 Int64) ENGINE = MergeTree PARTITION BY id1 ORDER BY (key1) ; +insert into test.tab values ( -1, 1, 0 ); +SELECT count(*) FROM test.tab PREWHERE id1 IN (1);