diff --git a/dbms/src/Core/Settings.h b/dbms/src/Core/Settings.h index a4b7233909a..c4f374fbc70 100644 --- a/dbms/src/Core/Settings.h +++ b/dbms/src/Core/Settings.h @@ -200,7 +200,7 @@ struct Settings : public SettingsCollection M(SettingBool, join_use_nulls, 0, "Use NULLs for non-joined rows of outer JOINs for types that can be inside Nullable. If false, use default value of corresponding columns data type.") \ \ M(SettingJoinStrictness, join_default_strictness, JoinStrictness::ALL, "Set default strictness in JOIN query. Possible values: empty string, 'ANY', 'ALL'. If empty, query without strictness will throw exception.") \ - M(SettingBool, any_join_get_any_from_right_table, false, "Enable ANY RIGHT|FULL JOIN that are not consistent with LEFT one. Right table in ANY JOIN has no key copies so it leads to confusing results for RIGHT and FULL JOINs. User expects 't1 ANY LEFT JOIN t2' is equal to 't2 ANY RIGHT JOIN t1'.") \ + M(SettingBool, any_join_distinct_right_table_keys, false, "Enable old ANY JOIN logic with many-to-one left-to-right table keys mapping for all ANY JOINs. It leads to confusing not equal results for 't1 ANY LEFT JOIN t2' and 't2 ANY RIGHT JOIN t1'. ANY RIGHT JOIN needs one-to-many keys maping to be consistent with LEFT one.") \ \ M(SettingUInt64, preferred_block_size_bytes, 1000000, "") \ \ diff --git a/dbms/src/Interpreters/SyntaxAnalyzer.cpp b/dbms/src/Interpreters/SyntaxAnalyzer.cpp index 663e667127e..fa5c4df9b95 100644 --- a/dbms/src/Interpreters/SyntaxAnalyzer.cpp +++ b/dbms/src/Interpreters/SyntaxAnalyzer.cpp @@ -546,14 +546,13 @@ void checkJoin(const ASTTablesInSelectQueryElement * join) const auto & table_join = join->table_join->as(); - if (table_join.strictness == ASTTableJoin::Strictness::Any || - table_join.strictness == ASTTableJoin::Strictness::Asof) - if (table_join.kind == ASTTableJoin::Kind::Right || - table_join.kind == ASTTableJoin::Kind::Full) - throw Exception("ANY RIGHT|FULL JOINs are disabled by default cause of confusing results: " - "'t1 ANY LEFT JOIN t2' is inconsistent with 't2 ANY RIGHT JOIN t1'." - "Default bahaviour is reserved for many-to-one ANY LEFT JOIN and one-to-many ANY RIGHT JOIN." - "Set any_join_get_any_from_right_table=1 to enable many-to-one ANY RIGHT|FULL JOINs.", + if (table_join.strictness == ASTTableJoin::Strictness::Any) + if (table_join.kind != ASTTableJoin::Kind::Left) + throw Exception("Old ANY INNER|RIGHT|FULL JOINs are disabled by default. Their logic would be changed." + "Old logic is many-to-one for all kinds of ANY JOINs. It's equil to apply distinct for right table keys." + "Default bahaviour is reserved for many-to-one LEFT JOIN, one-to-many RIGHT JOIN and one-to-one INNER JOIN." + "It would be equal to apply distinct for keys to right, left and both tables respectively." + "Set any_join_distinct_right_table_keys=1 to enable old bahaviour.", ErrorCodes::NOT_IMPLEMENTED); } @@ -597,7 +596,7 @@ SyntaxAnalyzerResultPtr SyntaxAnalyzer::analyze( if (const ASTTablesInSelectQueryElement * node = select_query->join()) { - if (!settings.any_join_get_any_from_right_table) + if (!settings.any_join_distinct_right_table_keys) checkJoin(node); if (settings.enable_optimize_predicate_expression) diff --git a/dbms/tests/queries/0_stateless/00051_any_inner_join.sql b/dbms/tests/queries/0_stateless/00051_any_inner_join.sql index 986c798d763..566b5ad526b 100644 --- a/dbms/tests/queries/0_stateless/00051_any_inner_join.sql +++ b/dbms/tests/queries/0_stateless/00051_any_inner_join.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + SELECT a.*, b.* FROM ( SELECT number AS k FROM system.numbers LIMIT 10 diff --git a/dbms/tests/queries/0_stateless/00098_l_union_all.sql b/dbms/tests/queries/0_stateless/00098_l_union_all.sql index 9a301297786..414baba92fa 100644 --- a/dbms/tests/queries/0_stateless/00098_l_union_all.sql +++ b/dbms/tests/queries/0_stateless/00098_l_union_all.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ANY INNER JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING (a) ORDER BY a,b,c,d ASC; SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ALL LEFT JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING (a) ORDER BY a,b,c,d ASC; SELECT a,b,c,d FROM (SELECT 1 AS a,2 AS b, 3 AS c UNION ALL SELECT 2,3,4 ) ALL LEFT JOIN (SELECT 1 AS a,2 AS b,4 AS d UNION ALL SELECT 2,3,5) USING a,b ORDER BY a,b,c,d ASC; diff --git a/dbms/tests/queries/0_stateless/00163_shard_join_with_empty_table.sql b/dbms/tests/queries/0_stateless/00163_shard_join_with_empty_table.sql index af4e8e79ff6..b6e1a260d25 100644 --- a/dbms/tests/queries/0_stateless/00163_shard_join_with_empty_table.sql +++ b/dbms/tests/queries/0_stateless/00163_shard_join_with_empty_table.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + SELECT number, number / 2 AS n, j1, j2 FROM remote('127.0.0.{2,3}', system.numbers) ANY LEFT JOIN (SELECT number / 3 AS n, number AS j1, 'Hello' AS j2 FROM system.numbers LIMIT 0) USING n LIMIT 10; SELECT dummy + 2 AS number, number / 2 AS n, j1, j2 FROM remote('127.0.0.{2,3}', system.one) ANY INNER JOIN (SELECT number / 3 AS n, number AS j1, 'Hello' AS j2 FROM system.numbers LIMIT 0) USING n LIMIT 10; SELECT number, number / 2 AS n, j1, j2 FROM remote('127.0.0.{2,3}', system.numbers) GLOBAL ANY LEFT JOIN (SELECT number / 3 AS n, number AS j1, 'Hello' AS j2 FROM system.numbers LIMIT 0) USING n LIMIT 10; diff --git a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql index 4938a633810..8e87f49a7a2 100644 --- a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql +++ b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + DROP TABLE IF EXISTS series; CREATE TABLE series(i UInt32, x_value Float64, y_value Float64) ENGINE = Memory; diff --git a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics_stable.sql b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics_stable.sql index 362d300f1d6..f51722f7f33 100644 --- a/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics_stable.sql +++ b/dbms/tests/queries/0_stateless/00181_aggregate_functions_statistics_stable.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + DROP TABLE IF EXISTS series; CREATE TABLE series(i UInt32, x_value Float64, y_value Float64) ENGINE = Memory; diff --git a/dbms/tests/queries/0_stateless/00203_full_join.sql b/dbms/tests/queries/0_stateless/00203_full_join.sql index fb6abbfa497..f664ae3bd95 100644 --- a/dbms/tests/queries/0_stateless/00203_full_join.sql +++ b/dbms/tests/queries/0_stateless/00203_full_join.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT k, x, y FROM (SELECT arrayJoin([1, 2, 3]) AS k, 'Hello' AS x) ANY FULL JOIN (SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k) USING k WHERE k < 10 ORDER BY k; SELECT k, x FROM (SELECT arrayJoin([1, 2, 3]) AS k, 'Hello' AS x) ANY FULL JOIN (SELECT range(k) AS y, arrayJoin([3, 4, 5]) AS k) USING k WHERE k < 10 ORDER BY k; @@ -24,7 +24,7 @@ INSERT INTO t2_00203 VALUES ('ccc', 4, 3, 2), ('ddd', 7, 6, 5); SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY FULL JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3; SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY RIGHT JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3; -SET any_join_get_any_from_right_table = 0; +SET any_join_distinct_right_table_keys = 0; SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY FULL JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3; -- { serverError 48 } SELECT k1, k2, k3, val_t1, val_t2 FROM t1_00203 ANY RIGHT JOIN t2_00203 USING (k3, k1, k2 AS k2_alias) ORDER BY k1, k2, k3; -- { serverError 48 } diff --git a/dbms/tests/queries/0_stateless/00219_full_right_join_column_order.sql b/dbms/tests/queries/0_stateless/00219_full_right_join_column_order.sql index 827d2ef8f05..9c7485992f6 100644 --- a/dbms/tests/queries/0_stateless/00219_full_right_join_column_order.sql +++ b/dbms/tests/queries/0_stateless/00219_full_right_join_column_order.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT a, b FROM (SELECT 1 AS a, 2000 AS b) ANY RIGHT JOIN (SELECT 2 AS a, 3000 AS b) USING a, b; SELECT a, b FROM (SELECT 1 AS a, 2000 AS b) ANY RIGHT JOIN (SELECT 2 AS a, 3000 AS b) USING b, a; diff --git a/dbms/tests/queries/0_stateless/00316_rounding_functions_and_empty_block.sql b/dbms/tests/queries/0_stateless/00316_rounding_functions_and_empty_block.sql index 2c13433a5c5..45dc76cb41d 100644 --- a/dbms/tests/queries/0_stateless/00316_rounding_functions_and_empty_block.sql +++ b/dbms/tests/queries/0_stateless/00316_rounding_functions_and_empty_block.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + SELECT floor((ReferrerTimestamp - InstallTimestamp) / 86400) AS DaysSinceInstallations FROM diff --git a/dbms/tests/queries/0_stateless/00353_join_by_tuple.sql b/dbms/tests/queries/0_stateless/00353_join_by_tuple.sql index 96565ff8430..5550effec2c 100644 --- a/dbms/tests/queries/0_stateless/00353_join_by_tuple.sql +++ b/dbms/tests/queries/0_stateless/00353_join_by_tuple.sql @@ -1 +1,2 @@ +set any_join_distinct_right_table_keys = 1; select a from (select (1, 2) as a) any inner join (select (1, 2) as a) using a; diff --git a/dbms/tests/queries/0_stateless/00370_duplicate_columns_in_subqueries.sql b/dbms/tests/queries/0_stateless/00370_duplicate_columns_in_subqueries.sql index 324fd8d033a..fb6b6ccfe34 100644 --- a/dbms/tests/queries/0_stateless/00370_duplicate_columns_in_subqueries.sql +++ b/dbms/tests/queries/0_stateless/00370_duplicate_columns_in_subqueries.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; select x, y from (select 1 as x, 2 as y, x, y); select x, y from (select 1 as x, 1 as y, x, y); diff --git a/dbms/tests/queries/0_stateless/00444_join_use_nulls.sql b/dbms/tests/queries/0_stateless/00444_join_use_nulls.sql index 4361c89b7da..1992c3cbcc9 100644 --- a/dbms/tests/queries/0_stateless/00444_join_use_nulls.sql +++ b/dbms/tests/queries/0_stateless/00444_join_use_nulls.sql @@ -1,5 +1,5 @@ SET join_use_nulls = 0; -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT k, a, b FROM diff --git a/dbms/tests/queries/0_stateless/00445_join_nullable_keys.sql b/dbms/tests/queries/0_stateless/00445_join_nullable_keys.sql index 402f02c8f55..fa5fec58364 100644 --- a/dbms/tests/queries/0_stateless/00445_join_nullable_keys.sql +++ b/dbms/tests/queries/0_stateless/00445_join_nullable_keys.sql @@ -1,5 +1,5 @@ SET join_use_nulls = 0; -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT k, a, b FROM diff --git a/dbms/tests/queries/0_stateless/00550_join_insert_select.sh b/dbms/tests/queries/0_stateless/00550_join_insert_select.sh index 827248d6c7e..168dad8ddc0 100755 --- a/dbms/tests/queries/0_stateless/00550_join_insert_select.sh +++ b/dbms/tests/queries/0_stateless/00550_join_insert_select.sh @@ -14,7 +14,7 @@ INSERT INTO test2_00550 VALUES ('a'); CREATE TABLE test3_00550 ( id String, name String ) ENGINE = StripeLog; INSERT INTO test3_00550 VALUES ('a', 'aaa'); -INSERT INTO test1_00550 SELECT id, name FROM test2_00550 ANY INNER JOIN test3_00550 USING (id); +INSERT INTO test1_00550 SELECT id, name FROM test2_00550 ANY INNER JOIN test3_00550 USING (id) SETTINGS any_join_distinct_right_table_keys=1; INSERT INTO test1_00550 SELECT id, name FROM test2_00550 ANY LEFT OUTER JOIN test3_00550 USING (id); DROP TABLE test1_00550; diff --git a/dbms/tests/queries/0_stateless/00555_right_join_excessive_rows.sql b/dbms/tests/queries/0_stateless/00555_right_join_excessive_rows.sql index d242abd0a3b..72ccbd4e58d 100644 --- a/dbms/tests/queries/0_stateless/00555_right_join_excessive_rows.sql +++ b/dbms/tests/queries/0_stateless/00555_right_join_excessive_rows.sql @@ -1,3 +1,3 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SET max_block_size = 10; SELECT * FROM (select toUInt64(1) s limit 1) any right join (select number s, s as x from numbers(11)) using (s) ORDER BY s; diff --git a/dbms/tests/queries/0_stateless/00561_storage_join.sql b/dbms/tests/queries/0_stateless/00561_storage_join.sql index f218f9a0bc2..bcbaaded9b0 100644 --- a/dbms/tests/queries/0_stateless/00561_storage_join.sql +++ b/dbms/tests/queries/0_stateless/00561_storage_join.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + drop table IF EXISTS joinbug; CREATE TABLE joinbug ( diff --git a/dbms/tests/queries/0_stateless/00577_full_join_segfault.sql b/dbms/tests/queries/0_stateless/00577_full_join_segfault.sql index ad6af07255f..d2fdab7c1c3 100644 --- a/dbms/tests/queries/0_stateless/00577_full_join_segfault.sql +++ b/dbms/tests/queries/0_stateless/00577_full_join_segfault.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT k, a1, b1, a2, b2 FROM (SELECT 0 AS k, 'hello' AS a1, 123 AS b1, a1) ANY FULL OUTER JOIN (SELECT 1 AS k, 'hello' AS a2, 456 AS b2, a2) USING (k) ORDER BY k; SELECT k, a, b FROM (SELECT 0 AS k, 'hello' AS a, 123 AS b, a) ANY FULL OUTER JOIN (SELECT 1 AS k) USING (k) ORDER BY k; diff --git a/dbms/tests/queries/0_stateless/00586_removing_unused_columns_from_subquery.sql b/dbms/tests/queries/0_stateless/00586_removing_unused_columns_from_subquery.sql index 715e43fa96a..07ea077a460 100644 --- a/dbms/tests/queries/0_stateless/00586_removing_unused_columns_from_subquery.sql +++ b/dbms/tests/queries/0_stateless/00586_removing_unused_columns_from_subquery.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + DROP TABLE IF EXISTS local_statements; DROP TABLE IF EXISTS statements; diff --git a/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql b/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql index d21b5b8f07f..e0d92b87e5c 100644 --- a/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql +++ b/dbms/tests/queries/0_stateless/00597_push_down_predicate.sql @@ -1,5 +1,5 @@ SET send_logs_level = 'none'; -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; DROP TABLE IF EXISTS test_00597; DROP TABLE IF EXISTS test_view_00597; diff --git a/dbms/tests/queries/0_stateless/00679_replace_asterisk.sql b/dbms/tests/queries/0_stateless/00679_replace_asterisk.sql index f3b664e64cc..6ac119bdf48 100644 --- a/dbms/tests/queries/0_stateless/00679_replace_asterisk.sql +++ b/dbms/tests/queries/0_stateless/00679_replace_asterisk.sql @@ -1,3 +1,5 @@ +set any_join_distinct_right_table_keys = 1; + SELECT * FROM (SELECT 1 AS id, 2 AS value); SELECT * FROM (SELECT 1 AS id, 2 AS value, 3 AS A) ANY INNER JOIN (SELECT 1 AS id, 4 AS values, 5 AS D) USING id; SELECT *, d.* FROM ( SELECT 1 AS id, 2 AS value ) ANY INNER JOIN ( SELECT 1 AS id, 3 AS values ) AS d USING id; diff --git a/dbms/tests/queries/0_stateless/00819_full_join_wrong_columns_in_block.sql b/dbms/tests/queries/0_stateless/00819_full_join_wrong_columns_in_block.sql index c84405deb14..5666d362912 100644 --- a/dbms/tests/queries/0_stateless/00819_full_join_wrong_columns_in_block.sql +++ b/dbms/tests/queries/0_stateless/00819_full_join_wrong_columns_in_block.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT * FROM (SELECT 1 AS a, 'x' AS b) join (SELECT 1 as a, 'y' as b) using a; SELECT * FROM (SELECT 1 AS a, 'x' AS b) left join (SELECT 1 as a, 'y' as b) using a; @@ -10,6 +10,6 @@ SELECT * FROM (SELECT 1 AS a, 'x' AS b) any left join (SELECT 1 as a, 'y' as b) SELECT * FROM (SELECT 1 AS a, 'x' AS b) any full join (SELECT 1 as a, 'y' as b) using a; SELECT * FROM (SELECT 1 AS a, 'x' AS b) any right join (SELECT 1 as a, 'y' as b) using a; -SET any_join_get_any_from_right_table = 0; +SET any_join_distinct_right_table_keys = 0; SELECT * FROM (SELECT 1 AS a, 'x' AS b) any full join (SELECT 1 as a, 'y' as b) using a; -- { serverError 48 } SELECT * FROM (SELECT 1 AS a, 'x' AS b) any right join (SELECT 1 as a, 'y' as b) using a; -- { serverError 48 } diff --git a/dbms/tests/queries/0_stateless/00846_join_using_tuple_crash.sql b/dbms/tests/queries/0_stateless/00846_join_using_tuple_crash.sql index 8f998aa77aa..f2968654782 100644 --- a/dbms/tests/queries/0_stateless/00846_join_using_tuple_crash.sql +++ b/dbms/tests/queries/0_stateless/00846_join_using_tuple_crash.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT * FROM (SELECT dummy as a, (toUInt8(0), toUInt8(0)) AS tup FROM system.one) JOIN (SELECT dummy as a, (toUInt8(0), toUInt8(0)) AS tup FROM system.one) diff --git a/dbms/tests/queries/0_stateless/00848_join_use_nulls_segfault.sql b/dbms/tests/queries/0_stateless/00848_join_use_nulls_segfault.sql index f0e7ff8eb70..d809950283d 100644 --- a/dbms/tests/queries/0_stateless/00848_join_use_nulls_segfault.sql +++ b/dbms/tests/queries/0_stateless/00848_join_use_nulls_segfault.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; DROP TABLE IF EXISTS t1_00848; DROP TABLE IF EXISTS t2_00848; diff --git a/dbms/tests/queries/0_stateless/00859_distinct_with_join.sql b/dbms/tests/queries/0_stateless/00859_distinct_with_join.sql index 057188f4f5a..23c41549502 100644 --- a/dbms/tests/queries/0_stateless/00859_distinct_with_join.sql +++ b/dbms/tests/queries/0_stateless/00859_distinct_with_join.sql @@ -1,3 +1,5 @@ +set any_join_distinct_right_table_keys = 1; + drop table if exists fooL; drop table if exists fooR; create table fooL (a Int32, v String) engine = Memory; diff --git a/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql index 1ef5e285a0f..22eeb2c51dc 100644 --- a/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql +++ b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; SELECT * FROM (SELECT 1 AS x) ALL LEFT JOIN (SELECT 1 AS x) USING x; SELECT * FROM (SELECT 1 AS x) ALL LEFT JOIN (SELECT 2 AS x) USING x; diff --git a/dbms/tests/queries/0_stateless/00927_table_filter.sql b/dbms/tests/queries/0_stateless/00927_table_filter.sql index 6777b342c32..ff9703be6cd 100644 --- a/dbms/tests/queries/0_stateless/00927_table_filter.sql +++ b/dbms/tests/queries/0_stateless/00927_table_filter.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +SET any_join_distinct_right_table_keys = 1; DROP TABLE IF EXISTS test.filtered_table1; DROP TABLE IF EXISTS test.filtered_table2; diff --git a/dbms/tests/queries/0_stateless/00956_join_use_nulls_with_array_column.sql b/dbms/tests/queries/0_stateless/00956_join_use_nulls_with_array_column.sql index 94fc3042f42..54741465a1d 100644 --- a/dbms/tests/queries/0_stateless/00956_join_use_nulls_with_array_column.sql +++ b/dbms/tests/queries/0_stateless/00956_join_use_nulls_with_array_column.sql @@ -1,3 +1,4 @@ +SET any_join_distinct_right_table_keys = 1; SET join_use_nulls = 1; SELECT number FROM system.numbers ANY INNER JOIN (SELECT number, ['test'] FROM system.numbers LIMIT 1) USING (number) LIMIT 1; -SELECT number FROM system.numbers ANY LEFT JOIN (SELECT number, ['test'] FROM system.numbers LIMIT 1) USING (number) LIMIT 1; \ No newline at end of file +SELECT number FROM system.numbers ANY LEFT JOIN (SELECT number, ['test'] FROM system.numbers LIMIT 1) USING (number) LIMIT 1; diff --git a/dbms/tests/queries/1_stateful/00063_loyalty_joins.sql b/dbms/tests/queries/1_stateful/00063_loyalty_joins.sql index f24a4221779..9613d3b8f67 100644 --- a/dbms/tests/queries/1_stateful/00063_loyalty_joins.sql +++ b/dbms/tests/queries/1_stateful/00063_loyalty_joins.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + SELECT loyalty, count() diff --git a/dbms/tests/queries/1_stateful/00065_loyalty_with_storage_join.sql b/dbms/tests/queries/1_stateful/00065_loyalty_with_storage_join.sql index f009a856ba9..d3e73faa7be 100644 --- a/dbms/tests/queries/1_stateful/00065_loyalty_with_storage_join.sql +++ b/dbms/tests/queries/1_stateful/00065_loyalty_with_storage_join.sql @@ -1,3 +1,5 @@ +SET any_join_distinct_right_table_keys = 1; + USE test; DROP TABLE IF EXISTS join; diff --git a/dbms/tests/queries/1_stateful/00074_full_join.sql b/dbms/tests/queries/1_stateful/00074_full_join.sql index 85edb9fecec..4497d82a666 100644 --- a/dbms/tests/queries/1_stateful/00074_full_join.sql +++ b/dbms/tests/queries/1_stateful/00074_full_join.sql @@ -1,4 +1,4 @@ -SET any_join_get_any_from_right_table = 1; +set any_join_distinct_right_table_keys = 1; SELECT CounterID,