diff --git a/tests/queries/0_stateless/01582_any_join_supertype.reference b/tests/queries/0_stateless/01582_any_join_supertype.reference index b4f45c4e403..a45cb12d3af 100644 --- a/tests/queries/0_stateless/01582_any_join_supertype.reference +++ b/tests/queries/0_stateless/01582_any_join_supertype.reference @@ -1,3 +1,5 @@ 1 2020-01-01 10:00:00 2020-01-01 10:00:00 +1 +2020-01-01 10:00:00 diff --git a/tests/queries/0_stateless/01582_any_join_supertype.sql b/tests/queries/0_stateless/01582_any_join_supertype.sql index 67b7d3ad087..6b06d78c83c 100644 --- a/tests/queries/0_stateless/01582_any_join_supertype.sql +++ b/tests/queries/0_stateless/01582_any_join_supertype.sql @@ -8,6 +8,7 @@ INSERT INTO foo VALUES ('2020-01-01', '2020-01-01 12:00:00', 'test1'), ('2020-01 INSERT INTO bar VALUES ('2020-01-01', 'test2'), ('2020-01-01', 'test3'); SET optimize_move_to_prewhere = 1; +SET any_join_distinct_right_table_keys = 0; SELECT count() FROM foo ANY INNER JOIN bar USING (dimension_1) @@ -21,5 +22,16 @@ WHERE toDate(foo.server_time, 'UTC') <= toDate('2020-04-30'); SELECT toDateTime(foo.server_time, 'UTC') FROM foo SEMI JOIN bar USING (dimension_1) WHERE toDate(foo.server_time, 'UTC') <= toDate('2020-04-30'); +SET any_join_distinct_right_table_keys = 1; + +SELECT count() +FROM foo ANY INNER JOIN bar USING (dimension_1) +WHERE (foo.server_date <= '2020-11-07') AND (toDate(foo.server_time, 'Asia/Yekaterinburg') <= '2020-11-07'); + +SELECT toDateTime(foo.server_time, 'UTC') +FROM foo +ANY INNER JOIN bar USING (dimension_1) +WHERE toDate(foo.server_time, 'UTC') <= toDate('2020-04-30'); + DROP TABLE foo; DROP TABLE bar;