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 de69348862a..0d430f5263d 100644 --- a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference +++ b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.reference @@ -11,3 +11,26 @@ key, arrayJoin(arr) in ((1, 1), (2, 2)) (key, left array join arr) in ((1, 1), (2, 2)) 1 2 +all +1 [1] +2 [2] +key, arrayJoin(n.x) in (1, 1) +1 1 +key, arrayJoin(n.x) in ((1, 1), (2, 2)) +1 1 +2 2 +(key, left array join n.x) in (1, 1) +1 +(key, left array join n.x) in ((1, 1), (2, 2)) +1 +2 +max(key) from tab where (key, left array join n.x) in (1, 1) +1 +1 +max(key) from tab where (key, left array join n.x) in ((1, 1), (2, 2)) +2 +2 +max(key) from tab any left join (select key, arrayJoin(n.x) as val from tab) using key where (key, val) in (1, 1) +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 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 f6e34909cae..3783bcb3f2f 100644 --- a/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql +++ b/dbms/tests/queries/0_stateless/00612_pk_in_tuple.sql @@ -14,3 +14,27 @@ select key from test.tab left array join arr as val where (key, val) in (1, 1); select '(key, left array join arr) in ((1, 1), (2, 2))'; select key from test.tab left array join arr as val where (key, val) in ((1, 1), (2, 2)) order by key; +drop table if exists test.tab; +create table test.tab (key UInt64, n Nested(x UInt64)) Engine = MergeTree order by key; +insert into test.tab values (1, [1]); +insert into test.tab values (2, [2]); +select 'all'; +select * from test.tab order by key; +select 'key, arrayJoin(n.x) in (1, 1)'; +select key, arrayJoin(n.x) as val from test.tab where (key, val) in (1, 1); +select 'key, arrayJoin(n.x) in ((1, 1), (2, 2))'; +select key, arrayJoin(n.x) as val from test.tab where (key, val) in ((1, 1), (2, 2)) order by key; +select '(key, left array join n.x) in (1, 1)'; +select key from test.tab left array join n.x as val where (key, val) in (1, 1); +select '(key, left array join n.x) in ((1, 1), (2, 2))'; +select key from test.tab left array join n.x as val where (key, val) in ((1, 1), (2, 2)) order by key; +select 'max(key) from tab where (key, left array join n.x) in (1, 1)'; +select max(key) from test.tab left array join `n.x` as val where (key, val) in ((1, 1)); +select max(key) from test.tab left array join n as val where (key, val.x) in (1, 1); +select 'max(key) from tab where (key, left array join n.x) in ((1, 1), (2, 2))'; +select max(key) from test.tab left array join `n.x` as val where (key, val) in ((1, 1), (2, 2)); +select max(key) from test.tab left array join n as val where (key, val.x) in ((1, 1), (2, 2)); +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)'; +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));