From 6cd27dbc43bc51c57a443f60f901e8f35df30f77 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Sat, 26 Apr 2025 14:06:24 +0700 Subject: [PATCH] MDEV-33281 Fix after-rebase commits --- mysql-test/main/lowercase_table.result | 2 +- mysql-test/main/opt_hint_timeout.result | 4 +- mysql-test/main/opt_hints.result | 76 +++++------ mysql-test/main/opt_hints_join_order.result | 144 ++++++++++---------- mysql-test/main/opt_hints_subquery.result | 88 ++++++------ 5 files changed, 157 insertions(+), 157 deletions(-) diff --git a/mysql-test/main/lowercase_table.result b/mysql-test/main/lowercase_table.result index eaeb495aa84..45612772894 100644 --- a/mysql-test/main/lowercase_table.result +++ b/mysql-test/main/lowercase_table.result @@ -230,7 +230,7 @@ a 1 2 Warnings: -Warning 4210 Hint BKA("A") is ignored as conflicting/duplicated +Warning 4217 Hint BKA("A") is ignored as conflicting/duplicated DROP TABLE t1; # # End of 11.7 tests diff --git a/mysql-test/main/opt_hint_timeout.result b/mysql-test/main/opt_hint_timeout.result index 2eb86462d18..ed4c3d47b37 100644 --- a/mysql-test/main/opt_hint_timeout.result +++ b/mysql-test/main/opt_hint_timeout.result @@ -49,7 +49,7 @@ SELECT /*+ MAX_EXECUTION_TIME(10) MAX_EXECUTION_TIME(100) */ count(*) FROM t1; count(*) 512 Warnings: -Warning 4210 Hint MAX_EXECUTION_TIME(100) is ignored as conflicting/duplicated +Warning 4217 Hint MAX_EXECUTION_TIME(100) is ignored as conflicting/duplicated # Wrong values SELECT /*+ MAX_EXECUTION_TIME(0) */ count(*) FROM t1; count(*) @@ -102,7 +102,7 @@ SELECT /*+ MAX_EXECUTION_TIME(30) */ count(*) FROM t1; count(*) 512 Warnings: -Warning 4210 Hint MAX_EXECUTION_TIME(30) is ignored as conflicting/duplicated +Warning 4217 Hint MAX_EXECUTION_TIME(30) is ignored as conflicting/duplicated SELECT count(*) FROM t1 UNION SELECT /*+ MAX_EXECUTION_TIME(30) */ count(*) FROM t1; diff --git a/mysql-test/main/opt_hints.result b/mysql-test/main/opt_hints.result index 1399e5b3770..b3ff6333b78 100644 --- a/mysql-test/main/opt_hints.result +++ b/mysql-test/main/opt_hints.result @@ -15,25 +15,25 @@ a 1 2 Warnings: -Warning 4213 Unresolved index name `t1`@`select#1` `idx_å` for NO_MRR hint +Warning 4220 Unresolved index name `t1`@`select#1` `idx_å` for NO_MRR hint SELECT /*+ NO_MRR(t1 idx_a, idx_å, idx_A) */ a FROM t1; a 1 2 Warnings: -Warning 4210 Hint NO_MRR(`t1` `idx_A`) is ignored as conflicting/duplicated -Warning 4213 Unresolved index name `t1`@`select#1` `idx_å` for NO_MRR hint +Warning 4217 Hint NO_MRR(`t1` `idx_A`) is ignored as conflicting/duplicated +Warning 4220 Unresolved index name `t1`@`select#1` `idx_å` for NO_MRR hint DROP TABLE t1; # Testing that query block names are accent sensitive case insensitive CREATE TABLE t1 (a INT); SELECT /*+ QB_NAME(a) BKA(t1@a) BKA(t1@A) */ * FROM t1; a Warnings: -Warning 4210 Hint BKA(`t1`@`A`) is ignored as conflicting/duplicated +Warning 4217 Hint BKA(`t1`@`A`) is ignored as conflicting/duplicated SELECT /*+ QB_NAME(a) BKA(t1@a) BKA(t1@å) */ * FROM t1; a Warnings: -Warning 4211 Query block name `å` is not found for BKA hint +Warning 4218 Query block name `å` is not found for BKA hint DROP TABLE t1; CREATE TABLE t1(f1 INT, f2 INT); INSERT INTO t1 VALUES @@ -230,7 +230,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00 1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Warning 4213 Unresolved index name `t5`@`select#2` `z_idx` for NO_ICP hint +Warning 4220 Unresolved index name `t5`@`select#2` `z_idx` for NO_ICP hint Note 1003 select /*+ NO_ICP(`t5`@`select#2` `y_idx`) NO_ICP(`t5`@`select#2` `x_idx`) */ `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and (8 + 0) # ICP should still be used EXPLAIN EXTENDED SELECT * FROM @@ -548,7 +548,7 @@ EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) QB_NAME(qb1 ) */ * FROM t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 28 100.00 Warnings: -Warning 4210 Hint QB_NAME(`qb1`) is ignored as conflicting/duplicated +Warning 4217 Hint QB_NAME(`qb1`) is ignored as conflicting/duplicated Note 1003 select /*+ QB_NAME(`qb1`) */ `test`.`t2`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3` from `test`.`t2` # Should issue warning EXPLAIN EXTENDED SELECT /*+ BKA(@qb1) QB_NAME(qb1) */ t2.f1, t2.f2, t2.f3 FROM t1,t2 @@ -557,7 +557,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL f1 NULL NULL NULL 28 25.00 Using where; Using join buffer (flat, BNL join) Warnings: -Warning 4211 Query block name `qb1` is not found for BKA hint +Warning 4218 Query block name `qb1` is not found for BKA hint Note 1003 select /*+ QB_NAME(`qb1`) */ `test`.`t2`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f2` between `test`.`t1`.`f1` and `test`.`t1`.`f2` and `test`.`t2`.`f2` + 1 >= `test`.`t1`.`f1` + 1 # Should not crash PREPARE stmt1 FROM "SELECT /*+ BKA(t2) */ t2.f1, t2.f2, t2.f3 FROM t1,t2 @@ -601,9 +601,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL f1 NULL NULL NULL 28 25.00 Using where; Using join buffer (flat, BNL join) Warnings: -Warning 4212 Unresolved table name `t3`@`select#1` for BKA hint -Warning 4212 Unresolved table name `t3`@`select#1` for NO_RANGE_OPTIMIZATION hint -Warning 4213 Unresolved index name `t3`@`select#1` `idx1` for NO_RANGE_OPTIMIZATION hint +Warning 4219 Unresolved table name `t3`@`select#1` for BKA hint +Warning 4219 Unresolved table name `t3`@`select#1` for NO_RANGE_OPTIMIZATION hint +Warning 4220 Unresolved index name `t3`@`select#1` `idx1` for NO_RANGE_OPTIMIZATION hint Note 1003 select /*+ BKA(`t2`@`select#1`) NO_BNL(`t1`@`select#1`) */ `test`.`t2`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f2` between `test`.`t1`.`f1` and `test`.`t1`.`f2` and `test`.`t2`.`f2` + 1 >= `test`.`t1`.`f1` + 1 # Check illegal syntax EXPLAIN EXTENDED SELECT /*+ BKA(qb1 t3@qb1) */ f2 FROM @@ -640,7 +640,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE tbl12 ALL NULL NULL NULL NULL 10 100.00 Using where 1 SIMPLE tbl13 hash_ALL a #hash#a 5 test.tbl12.a 1000 0.10 Using where; Using join buffer (flat, BNLH join) Warnings: -Warning 4212 Unresolved table name `tbl2`@`select#1` for BKA hint +Warning 4219 Unresolved table name `tbl2`@`select#1` for BKA hint Note 1003 select `test`.`tbl12`.`a` AS `a`,`test`.`tbl12`.`b` AS `b`,`test`.`tbl13`.`a` AS `a`,`test`.`tbl13`.`b` AS `b`,`test`.`tbl13`.`c` AS `c`,`test`.`tbl13`.`filler` AS `filler` from `test`.`t12` `tbl12` join `test`.`t13` `tbl13` where `test`.`tbl13`.`a` = `test`.`tbl12`.`a` and `test`.`tbl13`.`b` + 1 <= `test`.`tbl13`.`b` + 1 # Check that PS and conventional statements give the same result. FLUSH STATUS; @@ -1476,19 +1476,19 @@ SELECT /*+ BKA() BKA() */ 1; 1 1 Warnings: -Warning 4210 Hint BKA() is ignored as conflicting/duplicated +Warning 4217 Hint BKA() is ignored as conflicting/duplicated SELECT /*+ BKA(t1) BKA(t1) */ * FROM t1; i Warnings: -Warning 4210 Hint BKA(`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint BKA(`t1`) is ignored as conflicting/duplicated SELECT /*+ QB_NAME(q1) BKA(t1@q1) BKA(t1@q1) */ * FROM t1; i Warnings: -Warning 4210 Hint BKA(`t1`@`q1`) is ignored as conflicting/duplicated +Warning 4217 Hint BKA(`t1`@`q1`) is ignored as conflicting/duplicated SELECT /*+ QB_NAME(q1) NO_ICP(@q1 t1 PRIMARY) NO_ICP(@q1 t1 PRIMARY) */ * FROM t1; i Warnings: -Warning 4210 Hint NO_ICP(`t1`@`q1` `PRIMARY`) is ignored as conflicting/duplicated +Warning 4217 Hint NO_ICP(`t1`@`q1` `PRIMARY`) is ignored as conflicting/duplicated DROP TABLE t1; # # Hints inside views are not supported @@ -1497,7 +1497,7 @@ CREATE TABLE t1 (a INT, INDEX idx_a(a)); INSERT INTO t1 VALUES (1),(2); CREATE VIEW v1 AS SELECT /*+ NO_MRR(t1 idx_a) */ a FROM t1; Warnings: -Warning 4214 Optimizer hints are not supported inside view definitions +Warning 4221 Optimizer hints are not supported inside view definitions SELECT * FROM v1; a 1 @@ -1513,13 +1513,13 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` CREATE OR REPLACE VIEW v1 AS SELECT /*+ NO_MRR(t1 idx_a) BKA(t1)*/ a FROM t1; Warnings: -Warning 4214 Optimizer hints are not supported inside view definitions +Warning 4221 Optimizer hints are not supported inside view definitions SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8mb4 utf8mb4_uca1400_ai_ci ALTER VIEW v1 AS SELECT /*+ QB_NAME(q1)*/ a FROM t1; Warnings: -Warning 4214 Optimizer hints are not supported inside view definitions +Warning 4221 Optimizer hints are not supported inside view definitions SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8mb4 utf8mb4_uca1400_ai_ci @@ -1686,15 +1686,15 @@ Warning 1064 Optimizer hint syntax error near 'b) */ 1 FROM t1 a, t1 b' at lin SELECT /*+ NO_ICP(i1) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `i1`@`select#1` for NO_ICP hint +Warning 4219 Unresolved table name `i1`@`select#1` for NO_ICP hint SELECT /*+ NO_ICP(i1 i2) */ 1 FROM t1; 1 Warnings: -Warning 4213 Unresolved index name `i1`@`select#1` `i2` for NO_ICP hint +Warning 4220 Unresolved index name `i1`@`select#1` `i2` for NO_ICP hint SELECT /*+ NO_ICP(@qb ident) */ 1 FROM t1; 1 Warnings: -Warning 4211 Query block name `qb` is not found for NO_ICP hint +Warning 4218 Query block name `qb` is not found for NO_ICP hint # valid hint sequences, no warnings expected: @@ -1749,49 +1749,49 @@ CREATE INDEX 3rd_index ON t1(i, j); SELECT /*+ NO_ICP(3rd_index) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `3rd_index`@`select#1` for NO_ICP hint +Warning 4219 Unresolved table name `3rd_index`@`select#1` for NO_ICP hint CREATE INDEX $index ON t1(j, i); SELECT /*+ NO_ICP($index) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `$index`@`select#1` for NO_ICP hint +Warning 4219 Unresolved table name `$index`@`select#1` for NO_ICP hint CREATE TABLE ` quoted name test` (i INT); SELECT /*+ BKA(` quoted name test`) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name ` quoted name test`@`select#1` for BKA hint +Warning 4219 Unresolved table name ` quoted name test`@`select#1` for BKA hint SELECT /*+ BKA(` quoted name test`@`select#1`) */ 1 FROM t1; 1 Warnings: -Warning 4211 Query block name `select#1` is not found for BKA hint +Warning 4218 Query block name `select#1` is not found for BKA hint DROP TABLE ` quoted name test`; SET SQL_MODE = 'ANSI_QUOTES'; CREATE TABLE " quoted name test" (i INT); SELECT /*+ BKA(" quoted name test") */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name " quoted name test"@"select#1" for BKA hint +Warning 4219 Unresolved table name " quoted name test"@"select#1" for BKA hint SELECT /*+ BKA(" quoted name test"@"select#1") */ 1 FROM t1; 1 Warnings: -Warning 4211 Query block name "select#1" is not found for BKA hint +Warning 4218 Query block name "select#1" is not found for BKA hint CREATE TABLE `test1``test2``` (i INT); SELECT /*+ BKA(`test1``test2```) */ 1; 1 1 Warnings: -Warning 4212 Unresolved table name "test1`test2`"@"select#1" for BKA hint +Warning 4219 Unresolved table name "test1`test2`"@"select#1" for BKA hint SELECT /*+ BKA("test1""test2""") */ 1; 1 1 Warnings: -Warning 4212 Unresolved table name "test1""test2"""@"select#1" for BKA hint +Warning 4219 Unresolved table name "test1""test2"""@"select#1" for BKA hint SET SQL_MODE = ''; # should warn: SELECT /*+ BKA(" quoted name test") */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name ` quoted name test`@`select#1` for BKA hint +Warning 4219 Unresolved table name ` quoted name test`@`select#1` for BKA hint DROP TABLE ` quoted name test`; DROP TABLE `test1``test2```; # Valid hints, no warning: @@ -1843,29 +1843,29 @@ CREATE TABLE tableТ (i INT); SELECT /*+ BKA(tableТ) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `tableТ`@`select#1` for BKA hint +Warning 4219 Unresolved table name `tableТ`@`select#1` for BKA hint SELECT /*+ BKA(test@tableТ) */ 1 FROM t1; 1 Warnings: -Warning 4211 Query block name `tableТ` is not found for BKA hint +Warning 4218 Query block name `tableТ` is not found for BKA hint DROP TABLE tableТ; CREATE TABLE таблица (i INT); SELECT /*+ BKA(`таблица`) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `таблица`@`select#1` for BKA hint +Warning 4219 Unresolved table name `таблица`@`select#1` for BKA hint SELECT /*+ BKA(таблица) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `таблица`@`select#1` for BKA hint +Warning 4219 Unresolved table name `таблица`@`select#1` for BKA hint SELECT /*+ BKA(test@таблица) */ 1 FROM t1; 1 Warnings: -Warning 4211 Query block name `таблица` is not found for BKA hint +Warning 4218 Query block name `таблица` is not found for BKA hint SELECT /*+ NO_ICP(`\D1`) */ 1 FROM t1; 1 Warnings: -Warning 4212 Unresolved table name `\D1`@`select#1` for NO_ICP hint +Warning 4219 Unresolved table name `\D1`@`select#1` for NO_ICP hint DROP TABLE таблица; # derived tables and other subqueries: @@ -1966,7 +1966,7 @@ NO_ICP(@qb ident) 1 1 Warnings: -Warning 4211 Query block name `qb` is not found for NO_ICP hint +Warning 4218 Query block name `qb` is not found for NO_ICP hint SELECT /*+ ? bad syntax */ 1; diff --git a/mysql-test/main/opt_hints_join_order.result b/mysql-test/main/opt_hints_join_order.result index bc96885e994..6c8c3a5cf6e 100644 --- a/mysql-test/main/opt_hints_join_order.result +++ b/mysql-test/main/opt_hints_join_order.result @@ -34,7 +34,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4215 Hint JOIN_PREFIX() is ignored as malformed +Warning 4222 Hint JOIN_PREFIX() is ignored as malformed Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1)*/ count(*) FROM t1, t2; @@ -42,7 +42,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4215 Hint JOIN_PREFIX(@`q1` ) is ignored as malformed +Warning 4222 Hint JOIN_PREFIX(@`q1` ) is ignored as malformed Note 1003 select /*+ QB_NAME(`q1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Hint must be ignored as malformed (table names are not allowed for the fixed order) EXPLAIN EXTENDED @@ -51,7 +51,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4215 Hint JOIN_FIXED_ORDER(`t2`) is ignored as malformed +Warning 4222 Hint JOIN_FIXED_ORDER(`t2`) is ignored as malformed Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Hint is applied: QB name is allowed for the fixed order EXPLAIN EXTENDED @@ -68,7 +68,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4211 Query block name `qb3` is not found for JOIN_FIXED_ORDER hint +Warning 4218 Query block name `qb3` is not found for JOIN_FIXED_ORDER hint Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` EXPLAIN EXTENDED SELECT /*+ JOIN_FIXED_ORDER()*/ STRAIGHT_JOIN count(*) FROM t1, t2; @@ -84,7 +84,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4210 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ JOIN_FIXED_ORDER() JOIN_PREFIX(t2)*/ count(*) FROM t1, t2; @@ -92,7 +92,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_FIXED_ORDER(@`select#1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Multiple join order hints of same type are not allowed (except JOIN_ORDER()) EXPLAIN EXTENDED @@ -101,7 +101,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t1) JOIN_SUFFIX(t2)*/ count(*) FROM t1, t2; @@ -109,7 +109,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Multiple JOIN_ORDER() hints are applied EXPLAIN EXTENDED @@ -166,7 +166,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4212 Unresolved table name `t3` for JOIN_SUFFIX hint +Warning 4219 Unresolved table name `t3` for JOIN_SUFFIX hint Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Invalid query block name EXPLAIN EXTENDED @@ -175,7 +175,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4211 Query block name `qbXXX` is not found for JOIN_SUFFIX hint +Warning 4218 Query block name `qbXXX` is not found for JOIN_SUFFIX hint Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(t1, t2@qb3)*/ count(*) FROM t1, t2; @@ -183,7 +183,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4212 Unresolved table name `t2`@`qb3` for JOIN_SUFFIX hint +Warning 4219 Unresolved table name `t2`@`qb3` for JOIN_SUFFIX hint Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qbXXX)*/ count(*) FROM t2, t1; @@ -191,7 +191,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) Warnings: -Warning 4211 Query block name `qbXXX` is not found for JOIN_FIXED_ORDER hint +Warning 4218 Query block name `qbXXX` is not found for JOIN_FIXED_ORDER hint Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` # Warning expected as the hint must not confuse `t2` in the subquery # with `t2` in the join @@ -202,7 +202,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 2 SUBQUERY t2 ALL NULL NULL NULL NULL 20 100.00 Warnings: -Warning 4212 Unresolved table name `t2`@`subq` for JOIN_PREFIX hint +Warning 4219 Unresolved table name `t2`@`subq` for JOIN_PREFIX hint Note 1003 /* select#1 */ select (/* select#2 */ select /*+ QB_NAME(`subq`) */ max(`test`.`t2`.`f1`) from `test`.`t2`) AS `SQ`,`test`.`t2`.`f1` AS `f1` from `test`.`t2` # No more than 64 join order hints are allowed. It is hard to construct # a test case where 64 hints will be applicable and only one, exceeding @@ -240,39 +240,39 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) Warnings: -Warning 4210 Hint JOIN_ORDER(`t1`,`t2`,`t3`,`t4`,`t5`,`t6`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_SUFFIX(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t1`,`t2`,`t3`,`t4`,`t5`,`t6`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Original query with no hints SELECT count(*) FROM t1 JOIN t2 JOIN t3 @@ -315,7 +315,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`,`t1`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_PREFIX(t3, t2, t1) JOIN_PREFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -327,7 +327,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`,`t1`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t3`,`t2`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t5`.`f1` = `test`.`t2`.`f1` # Second JOIN_SUFFIX is conflicting SELECT /*+ JOIN_SUFFIX(t3, t2) JOIN_SUFFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -336,7 +336,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t2`,`t1`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_SUFFIX(t3, t2) JOIN_SUFFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -347,7 +347,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t2`,`t1`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Both JOIN_ORDERs applicable SELECT /*+ JOIN_ORDER(t3, t2) JOIN_ORDER(t1, t2, t5@subq2) */ count(*) @@ -375,7 +375,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4212 Unresolved table name `t7` for JOIN_ORDER hint +Warning 4219 Unresolved table name `t7` for JOIN_ORDER hint explain extended SELECT /*+ JOIN_ORDER(t1, t7, t5) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -386,7 +386,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) Warnings: -Warning 4212 Unresolved table name `t7` for JOIN_ORDER hint +Warning 4219 Unresolved table name `t7` for JOIN_ORDER hint Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # All hints are applicable SELECT /*+ JOIN_PREFIX(t2, t5@subq2, t4@subq1) @@ -416,7 +416,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_ORDER(t2, t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -427,7 +427,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # JOIN_SUFFIX is ignored SELECT /*+ JOIN_ORDER(t3, t2) JOIN_SUFFIX(t3) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -436,7 +436,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t3`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_SUFFIX(t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -447,7 +447,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t3`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # JOIN_PREFIX is ignored SELECT /*+ JOIN_ORDER(t3, t2) JOIN_PREFIX(t2) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -456,7 +456,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_PREFIX(t2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -467,7 +467,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) Warnings: -Warning 4210 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # All hints are applicable SELECT /*+ JOIN_ORDER(t4@subq1, t3) JOIN_SUFFIX(t1) JOIN_PREFIX(t2, t5@subq2, t4@subq1) */ count(*) @@ -576,7 +576,7 @@ AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t1`) is ignored as conflicting/duplicated explain extended SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2, t1) */ STRAIGHT_JOIN count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -588,7 +588,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED t5 ALL PRIMARY NULL NULL NULL 1 100.00 2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t1`) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ QB_NAME(`q1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` where <`test`.`t1`.`f1`>((`test`.`t1`.`f1`,(/* select#2 */ select /*+ QB_NAME(`subq1`) */ `test`.`t4`.`f1` from `test`.`t4` where (`test`.`t1`.`f1`) = `test`.`t4`.`f1`))) and <`test`.`t2`.`f1`>((`test`.`t2`.`f1`,`test`.`t2`.`f1` in ( (/* select#3 */ select /*+ QB_NAME(`subq2`) */ `test`.`t5`.`f1` from `test`.`t5` ), (`test`.`t2`.`f1` in on distinct_key where `test`.`t2`.`f1` = ``.`f1`)))) # Test JOIN_FIXED_ORDER. SELECT /*+ QB_NAME(q1) JOIN_FIXED_ORDER(@q1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -660,7 +660,7 @@ WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); count(*) 10 Warnings: -Warning 4210 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_PREFIX(t3, t1) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -670,7 +670,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) Warnings: -Warning 4210 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Hint is applicable SELECT /*+ JOIN_PREFIX(t1, t2, t3) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 @@ -777,7 +777,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) 1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t4`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t4`,`t1`) is ignored as conflicting/duplicated Note 1003 select 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t2, t1, t4) */ 1 FROM t1 JOIN t2 ON 1 @@ -922,7 +922,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where 1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Warning 4210 Hint JOIN_SUFFIX(`ta2`,`t3`,`ta1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`ta2`,`t3`,`ta1`) is ignored as conflicting/duplicated Note 1003 delete from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Both hints are ignored EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(ta1, t2, t3) JOIN_SUFFIX(t3, ta2) */ @@ -935,8 +935,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where 1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Warning 4210 Hint JOIN_PREFIX(`ta1`,`t2`,`t3`) is ignored as conflicting/duplicated -Warning 4210 Hint JOIN_SUFFIX(`t3`,`ta2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`ta1`,`t2`,`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t3`,`ta2`) is ignored as conflicting/duplicated Note 1003 delete from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 DROP TABLE t1, t2, t3; # Const table behavior, table order is not changed, hint is applicable. @@ -980,7 +980,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 Using where Warnings: -Warning 4210 Hint JOIN_SUFFIX(`t1`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_SUFFIX(`t1`,`t2`) is ignored as conflicting/duplicated DROP TABLE t1, t2; CREATE TABLE t1 ( @@ -1008,7 +1008,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t1 ref f1 f1 5 test.t3.f1 1 100.00 Using where; Using index Warnings: -Warning 4210 Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t3`) */ `test`.`t3`.`f1` AS `f1` from `test`.`t2` join `test`.`t3` left join `test`.`t1` on(`test`.`t1`.`f1` = `test`.`t3`.`f1` and `test`.`t3`.`f1` is not null) where `test`.`t2`.`f1` < 7 and convert(`test`.`t3`.`f2` using utf8mb3) = `test`.`t2`.`f2` EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t1, t2) JOIN_ORDER(t2, t3) */ t3.f1 FROM ( t2 INNER JOIN t3 ON t3.f2 = t2.f2 LEFT JOIN t1 ON t1.f1 = t3.f1 ) @@ -1018,7 +1018,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref f1 f1 5 test.t3.f1 1 100.00 Using where; Using index 1 SIMPLE t2 ref f2,f1 f2 768 func 1 100.00 Using index condition; Using where Warnings: -Warning 4210 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated Note 1003 select /*+ JOIN_ORDER(@`select#1` `t1`,`t2`) */ `test`.`t3`.`f1` AS `f1` from `test`.`t2` join `test`.`t3` left join `test`.`t1` on(`test`.`t1`.`f1` = `test`.`t3`.`f1` and `test`.`t3`.`f1` is not null) where `test`.`t2`.`f1` < 7 and convert(`test`.`t3`.`f2` using utf8mb3) = `test`.`t2`.`f2` DROP TABLE t1, t2, t3; CREATE TABLE t1 ( @@ -1035,7 +1035,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.f2 1 100.00 Warnings: -Warning 4210 Hint JOIN_PREFIX(`t1`,`t1`) is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_PREFIX(`t1`,`t1`) is ignored as conflicting/duplicated Note 1003 select `test`.`t2`.`f1` AS `f1` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f2` DROP TABLE t1, t2; CREATE TABLE t1 @@ -1069,7 +1069,7 @@ WHERE ('i','b') IN (SELECT f3, f1 FROM t2 WHERE f2 <> f2 AND als2.f2 IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Warning 4210 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated +Warning 4217 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated Note 1276 Field or reference 'test.als2.f2' of SELECT #2 was resolved in SELECT #1 Note 1003 update /*+ JOIN_ORDER(@`select#1` `t2`,`als1`,`als3`) */ (`test`.`t2`) join `test`.`t3` `als4` left join (`test`.`t3` `als1` join `test`.`t1` `als2` join `test`.`t1` `als3`) on(`test`.`als1`.`f3` = `test`.`als4`.`f2` and multiple equal(`test`.`als1`.`f1`, `test`.`als3`.`f3`) and multiple equal(`test`.`als1`.`f3`, `test`.`als2`.`f1`)) set `test`.`als1`.`f4` = 'eogqjvbhzodzimqahyzlktkbexkhdwxwgifikhcgblhgswxyutepc' where 0 DROP TABLE t1, t2, t3; @@ -1238,7 +1238,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref f2 f2 5 const 1 100.00 Using index condition; Using where 1 SIMPLE t1 ref f2 f2 5 test.t2.f3 1 100.00 Using index Warnings: -Warning 4212 Unresolved table name `alias1` for JOIN_PREFIX hint +Warning 4219 Unresolved table name `alias1` for JOIN_PREFIX hint Note 1003 select `test`.`t2`.`f3` AS `field1` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`f2` = `test`.`t2`.`f3` and `test`.`t2`.`f2` is null having `f3` <> 3 and `f3` >= 8 DROP TABLE t1, t2; # diff --git a/mysql-test/main/opt_hints_subquery.result b/mysql-test/main/opt_hints_subquery.result index d37f7cc77ca..f90d745d175 100644 --- a/mysql-test/main/opt_hints_subquery.result +++ b/mysql-test/main/opt_hints_subquery.result @@ -158,7 +158,7 @@ a 3 4 Warnings: -Warning 4211 Query block name `qb1` is not found for SUBQUERY hint +Warning 4218 Query block name `qb1` is not found for SUBQUERY hint SELECT /*+ SUBQUERY() */ a FROM t1; a 1 @@ -195,15 +195,15 @@ SELECT /*+ SEMIJOIN() SEMIJOIN(dupsweedout) NO_SEMIJOIN(firstmatch)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(DUPSWEEDOUT) is ignored as conflicting/duplicated -Warning 4210 Hint NO_SEMIJOIN(FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(DUPSWEEDOUT) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`select#1`) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(loosescan,materialization) SEMIJOIN(dupsweedout)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(DUPSWEEDOUT) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(DUPSWEEDOUT) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`select#1` LOOSESCAN, MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ NO_SEMIJOIN(firstmatch,loosescan,materialization) SEMIJOIN() NO_SEMIJOIN()*/ a @@ -211,8 +211,8 @@ FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN() is ignored as conflicting/duplicated -Warning 4210 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated Note 1003 select /*+ NO_SEMIJOIN(@`select#1` FIRSTMATCH, LOOSESCAN, MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) SEMIJOIN(@qb1) SEMIJOIN(loosescan) NO_SEMIJOIN(@qb1 dupsweedout)*/ a @@ -220,36 +220,36 @@ FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(LOOSESCAN) is ignored as conflicting/duplicated -Warning 4210 Hint NO_SEMIJOIN(@`qb1` DUPSWEEDOUT) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(LOOSESCAN) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`qb1` DUPSWEEDOUT) is ignored as conflicting/duplicated Note 1003 select /*+ QB_NAME(`qb1`) SEMIJOIN(@`qb1`) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(firstmatch) NO_SEMIJOIN()*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`select#1` FIRSTMATCH) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SUBQUERY(materialization) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ SUBQUERY(@`select#1` MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SEMIJOIN() SUBQUERY(materialization) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`select#1`) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SUBQUERY(materialization) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ SUBQUERY(@`select#1` MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SUBQUERY(materialization) SUBQUERY(intoexists) SUBQUERY(materialization)*/ a @@ -257,32 +257,32 @@ FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated -Warning 4210 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated Note 1003 select /*+ SUBQUERY(@`select#1` MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SUBQUERY(materialization) SEMIJOIN(firstmatch) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(FIRSTMATCH) is ignored as conflicting/duplicated -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ SUBQUERY(@`select#1` MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) SEMIJOIN(@qb1) SUBQUERY(@qb1 materialization) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(@`qb1` MATERIALIZATION) is ignored as conflicting/duplicated -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(@`qb1` MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ QB_NAME(`qb1`) SEMIJOIN(@`qb1`) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) SUBQUERY(@qb1 materialization) SEMIJOIN(@qb1 firstmatch) SUBQUERY(intoexists)*/ a FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(@`qb1` FIRSTMATCH) is ignored as conflicting/duplicated -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`qb1` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 select /*+ QB_NAME(`qb1`) SUBQUERY(@`qb1` MATERIALIZATION) */ `test`.`t1`.`a` AS `a` from `test`.`t1` EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(@qb1) SEMIJOIN(loosescan) NO_SEMIJOIN(@qb1 dupsweedout)*/ a @@ -291,7 +291,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 2 DERIVED t2 index NULL a 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint NO_SEMIJOIN(@`qb1` DUPSWEEDOUT) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`qb1` DUPSWEEDOUT) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SEMIJOIN(@`qb1`) SEMIJOIN(@`select#1` LOOSESCAN) */ `tt`.`a` AS `a` from (/* select#2 */ select /*+ QB_NAME(`qb1`) */ `test`.`t2`.`a` AS `a` from `test`.`t2`) `tt` DROP TABLE t1, t2 ,t3; set optimizer_switch=default; @@ -1434,7 +1434,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN() is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`select#2`) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Try opposite order EXPLAIN EXTENDED @@ -1444,7 +1444,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t2 ref a a 4 test.t1.a 1 100.00 Using index Warnings: -Warning 4210 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN() is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`select#2`) */ `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` # Specify at different levels, hint inside block has effect EXPLAIN EXTENDED @@ -1454,7 +1454,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t2 ref a a 4 test.t1.a 1 100.00 Using index Warnings: -Warning 4210 Hint NO_SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` # Specify at different levels, opposite order EXPLAIN EXTENDED @@ -1464,7 +1464,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Duplicate hints also gives warning, but hint has effect EXPLAIN EXTENDED @@ -1474,7 +1474,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t2 ref a a 4 test.t1.a 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT /*+ NO_SEMIJOIN(@subq) */ * FROM t2 @@ -1483,7 +1483,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint NO_SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`subq` ) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Multiple subqueries with conflicting hints EXPLAIN EXTENDED @@ -1495,8 +1495,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary 2 DEPENDENT SUBQUERY t3 index_subquery a a 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated -Warning 4210 Hint SEMIJOIN(@`subq2` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq2` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`subq1`) SEMIJOIN(@`subq2` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`b` and <`test`.`t1`.`a`>((`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t3 on a)))) EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(@subq1 LOOSESCAN) SEMIJOIN(@subq2 FIRSTMATCH) */ * FROM t1 @@ -1507,8 +1507,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) 1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary Warnings: -Warning 4210 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated -Warning 4210 Hint SEMIJOIN(@`subq2` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq2` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ NO_SEMIJOIN(@`subq1` LOOSESCAN) SEMIJOIN(@`subq2` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Conflicting hints in same hint comment EXPLAIN EXTENDED @@ -1520,7 +1520,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where 1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) Warnings: -Warning 4210 Hint SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(@subq1 LOOSESCAN) NO_SEMIJOIN(@subq1 LOOSESCAN) */ * @@ -1532,7 +1532,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where 1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) Warnings: -Warning 4210 Hint NO_SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` EXPLAIN EXTENDED SELECT /*+ NO_SEMIJOIN(@subq1 LOOSESCAN) NO_SEMIJOIN(@subq1 FIRSTMATCH) */ * @@ -1544,7 +1544,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) 1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t3) Warnings: -Warning 4210 Hint NO_SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint NO_SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ NO_SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Non-supported strategies should give warnings EXPLAIN EXTENDED @@ -1770,7 +1770,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 MATERIALIZED t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(INTOEXISTS) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`select#2` MATERIALIZATION) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` ), (`test`.`t2`.`a` in on distinct_key where `test`.`t2`.`a` = ``.`a`)))) # Try opposite order EXPLAIN EXTENDED @@ -1781,7 +1781,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`select#2` INTOEXISTS) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Specify at different levels, hint inside block has effect EXPLAIN EXTENDED @@ -1791,7 +1791,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(@`subq` MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(@`subq` MATERIALIZATION) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`subq` INTOEXISTS) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Specify at different levels, opposite order EXPLAIN EXTENDED @@ -1801,7 +1801,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 MATERIALIZED t1 index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(@`subq` INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(@`subq` INTOEXISTS) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`subq` MATERIALIZATION) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,`test`.`t2`.`a` in ( (/* select#2 */ select /*+ QB_NAME(`subq`) */ `test`.`t1`.`a` from `test`.`t1` ), (`test`.`t2`.`a` in on distinct_key where `test`.`t2`.`a` = ``.`a`)))) # Specifying combinations of SUBQUERY and SEMIJOIN/NO_SEMIJOIN # for same query block gives warning @@ -1813,7 +1813,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN() is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN() is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`select#2` INTOEXISTS) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Try opposite order EXPLAIN EXTENDED @@ -1823,7 +1823,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(MATERIALIZATION) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`select#2`) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) # Specify at different levels, hint inside block has effect EXPLAIN EXTENDED @@ -1833,7 +1833,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index 1 PRIMARY t2 ref a a 4 test.t1.a 1 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(@`subq` MATERIALIZATION) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(@`subq` MATERIALIZATION) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT /*+ SUBQUERY(@subq INTOEXISTS) */ * FROM t2 @@ -1842,7 +1842,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SUBQUERY(@`subq` INTOEXISTS) is ignored as conflicting/duplicated +Warning 4217 Hint SUBQUERY(@`subq` INTOEXISTS) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ NO_SEMIJOIN(@`subq`) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) EXPLAIN EXTENDED SELECT /*+ SEMIJOIN(@subq FIRSTMATCH) */ * FROM t2 @@ -1851,6 +1851,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL a 4 NULL 6 100.00 Using where; Using index 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index Warnings: -Warning 4210 Hint SEMIJOIN(@`subq` FIRSTMATCH) is ignored as conflicting/duplicated +Warning 4217 Hint SEMIJOIN(@`subq` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ SUBQUERY(@`subq` INTOEXISTS) */ `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) DROP TABLE t1,t2,t3;