psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force "our" variable $opt_replay_server redeclared at ./mysql-test-run line 298. "our" variable $opt_replay_server_manual redeclared at ./mysql-test-run line 299. Logging: ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled Using suites: main Collecting tests... Installing system database... Starting replay server... Copying /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/install.db to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data... Starting mysqld on port 10011 with socket /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock... Command: /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd --no-defaults --datadir=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data --port=10011 --socket=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock --pid-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.pid --log-error=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.err --general-log=1 --general-log-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log --skip-networking=0 --skip-grant-tables --key-buffer-size=1M --sort-buffer-size=256K --max-heap-table-size=1M Server process started with PID 890968 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 main.max_statement_time [ disabled ] cannot possibly work, depends on timing main.mysql_embedded [ disabled ] Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 main.partition_open_files_limit [ disabled ] open_files_limit check broken by MDEV-18360 main.read_many_rows_innodb [ disabled ] Bug#11748886 2010-11-15 mattiasj report already exists main.tablespace [ disabled ] disabled in MariaDB (no TABLESPACE table attribute) main.mysql_install_db_win_admin [ skipped ] Requires admin privileges main.charset_client_win [ skipped ] Not tested with utf8 command line support main.mariadb-upgrade-service [ skipped ] Requires admin privileges main.openssl_6975 [ skipped ] no or wrong openssl version main.winservice_basic [ skipped ] Requires admin privileges main.winservice_i18n [ skipped ] Requires admin privileges main.connect-abstract [ pass ] main.connect [ pass ] 14445 main.connect2 [ pass ] 35 main.join_cache_notasan [ pass ] 60 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.pool_of_threads [ fail ] Test ended at 2026-04-22 13:55:52 CURRENT_TEST: main.pool_of_threads --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.result 2026-04-02 14:38:09.434657437 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.reject 2026-04-22 13:55:52.036738615 +0300 @@ -628,9 +628,6 @@ fld3 period breaking 1001 explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 const fld1 fld1 4 const 1 -1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 select fld3,period from t2,t1 where companynr*10 = 37*10; fld3 period breaking 9410 @@ -1518,8 +1515,6 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -2013,7 +2008,7 @@ 4181 explain select min(fld1),max(fld1),count(*) from t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) 0 1232609 1199 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' main.ssl_encrypted_key 'env' [ pass ] 116 main.ssl_encrypted_key 'file' [ pass ] 106 main.ssl_encrypted_key 'pass' [ pass ] 91 main.optimizer_costs2 [ pass ] 7 main.ipv4_and_ipv6 [ pass ] 438 main.ipv4_as_ipv6 [ pass ] 1170 main.ipv6 [ pass ] 563 main.bind_multiple_addresses_resolution [ pass ] 43 main.bind_address_resolution [ pass ] 39 main.sp_trans_log [ pass ] 116 main.tc_heuristic_recover [ pass ] 3047 main.merge_alter [ pass ] 61 main.mysqlbinlog_row_minimal [ pass ] 234 main.long_unique_bugs [ pass ] 537 main.tmp_space_usage [ pass ] 15382 main.stat_tables_rbr [ pass ] 112 main.ctype_cp932_binlog_row [ pass ] 122 main.mysqlbinlog_row_compressed [ pass ] 133 main.invisible_partition [ pass ] 35 main.mysqlbinlog-innodb [ pass ] 47 main.partition_innodb_stmt [ pass ] 57 main.session_tracker_sysvar [ pass ] 21 main.tmp_table_binlog [ pass ] 26 main.mysqlbinlog [ pass ] 1401 main.mysqlbinlog_stmt_compressed [ pass ] 115 main.set_statement_notembedded_binlog [ pass ] 21 main.partition_binlog_stmt [ pass ] 29 main.backup_lock_binlog [ pass ] 2018 main.lock_tables_lost_commit [ pass ] 32 main.ctype_collate_implicit_def [ pass ] 37 main.ctype_filesystem [ pass ] 5 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ps [ fail ] Test ended at 2026-04-22 13:56:52 CURRENT_TEST: main.ps /home/psergey/dev-git/11.8-skip-records-in-range/client//mariadb-test: Error on delete of '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/f1.txt' (Errcode: 2 "No such file or directory") --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.result 2026-04-17 18:40:40.470800601 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.reject 2026-04-22 13:56:52.367652997 +0300 @@ -2146,8 +2146,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2157,8 +2160,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2168,8 +2174,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2179,8 +2188,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; create function func_1() returns int begin flush tables; return 1; end| @@ -2195,8 +2207,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 prepare abc from "flush tables"; execute abc; @@ -2207,8 +2222,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2218,8 +2236,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2229,8 +2250,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; deallocate prepare abc; @@ -3963,7 +3987,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3978,7 +4002,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3993,7 +4017,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 3 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4008,7 +4032,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4163,7 +4187,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -4178,7 +4202,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -5500,13 +5524,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` SHOW WARNINGS; Level Code Message -Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings # and their content must be the same as in case running the statement # in regular way @@ -5537,8 +5556,6 @@ EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0) PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )"; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows filtered Extra Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ps/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ps/' main.mysqlcheck [ pass ] 2194 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_varchar [ fail ] Test ended at 2026-04-22 13:56:57 CURRENT_TEST: main.type_varchar --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.result 2026-04-17 18:40:40.524803938 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.reject 2026-04-22 13:56:57.783115423 +0300 @@ -112,7 +112,7 @@ 1 SIMPLE t1 ref v v 257 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 257 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -136,7 +136,7 @@ 1 SIMPLE t1 ref v v 258 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -160,7 +160,7 @@ 1 SIMPLE t1 ref v v 259 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -184,7 +184,7 @@ 1 SIMPLE t1 ref v v 260 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -208,7 +208,7 @@ 1 SIMPLE t1 ref v v 261 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(259); select * from t1 where v like 'This is a test' order by v; v @@ -232,7 +232,7 @@ 1 SIMPLE t1 ref v v 262 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 262 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -256,7 +256,7 @@ 1 SIMPLE t1 ref v v 261 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -280,7 +280,7 @@ 1 SIMPLE t1 ref v v 260 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -304,7 +304,7 @@ 1 SIMPLE t1 ref v v 259 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -328,7 +328,7 @@ 1 SIMPLE t1 ref v v 258 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(254); select * from t1 where v like 'This is a test' order by v; v @@ -352,7 +352,7 @@ 1 SIMPLE t1 ref v v 257 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 257 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(253); alter table t1 change v v varchar(254), drop key v; alter table t1 change v v varchar(300), add key (v(10)); @@ -378,7 +378,7 @@ 1 SIMPLE t1 ref v v 13 const 4 Using where explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 3 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol)) charset=latin1; insert into t1 values ('test', 'something'); @@ -620,8 +620,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index -Warnings: -Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date` SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1; c1 2001-01-01 @@ -631,8 +629,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index -Warnings: -Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date` DROP TABLE IF EXISTS t1,t2; # # MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases @@ -975,15 +971,9 @@ EXPLAIN SELECT * FROM t1 WHERE i>30 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index i i 33 NULL 5 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int` EXPLAIN SELECT * FROM t1 WHERE i>=30 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index i i 33 NULL 5 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int` DROP TABLE t1; SET note_verbosity=DEFAULT; # @@ -1004,8 +994,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1=10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` = "10" of type `int` SELECT * FROM t1 WHERE c1=10; c1 Warnings: @@ -1023,8 +1011,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1<10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` < "10" of type `int` SELECT * FROM t1 WHERE c1<10; c1 a @@ -1052,8 +1038,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 BETWEEN 10 AND 11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` >= "10" of type `int` SELECT * FROM t1 WHERE c1 BETWEEN 10 AND 11; c1 Warnings: @@ -1071,8 +1055,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 BETWEEN 10 AND '11'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` >= "10" of type `int` SELECT * FROM t1 WHERE c1 BETWEEN 10 AND '11'; c1 Warnings: @@ -1090,8 +1072,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN (10,20); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` = "10" of type `int` SELECT * FROM t1 WHERE c1 IN (10,20); c1 Warnings: @@ -1109,8 +1089,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN (_latin1'a' COLLATE latin1_german2_ci,'b'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of collation `latin1_swedish_ci` = "_latin1'a' collate latin1_german2_ci" of collation `latin1_german2_ci` SELECT * FROM t1 WHERE c1 IN (_latin1'a' COLLATE latin1_german2_ci,'b'); c1 a @@ -1120,8 +1098,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN ('a',_latin1'b' COLLATE latin1_german2_ci); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of collation `latin1_swedish_ci` = "'a'" of collation `latin1_german2_ci` SELECT * FROM t1 WHERE c1 IN ('a',_latin1'b' COLLATE latin1_german2_ci); c1 a @@ -1136,9 +1112,6 @@ EXPLAIN SELECT * FROM t1 WHERE i >= 10 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL i NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "10" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "10" of type `int` SELECT * FROM t1 WHERE i >= 10 ORDER BY i LIMIT 5; a i NULL 10 @@ -1152,43 +1125,27 @@ EXPLAIN UPDATE t1 SET a = 1 WHERE i = 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i < 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i = 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i < 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i = 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i < 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i = 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i < 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` DROP TABLE t1; SET note_verbosity=DEFAULT; # Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_varchar/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_varchar/' main.upgrade [ pass ] 108 main.ctype_ucs2_query_cache [ pass ] 38 main.ctype_ucs2_def [ pass ] 37 main.ctype_utf16_def [ pass ] 28 main.ctype_utf32_def [ pass ] 23 main.lowercase_utf8 [ pass ] 6 main.bug47671 [ pass ] 46 main.ctype_utf8_def_upgrade [ pass ] 28 main.mysql_upgrade-34014 [ pass ] 2756 main.ctype_utf8mb4_unicode_ci_def [ pass ] 39 main.ctype_ldml [ pass ] 345 main.grant [ pass ] 508 main.grant2 [ pass ] 214 main.grant4 [ pass ] 92 main.mysqldump [ pass ] 51428 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_innodb [ fail ] Test ended at 2026-04-22 13:58:04 CURRENT_TEST: main.ctype_utf8mb4_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.result 2026-04-02 14:38:09.327657727 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.reject 2026-04-22 13:58:04.160543942 +0300 @@ -1682,10 +1682,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 53 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 53 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 53 const 4 Using where; Using index +1 SIMPLE t1 ref a a 53 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_innodb/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_innodb/' main.mysqldump-max [ pass ] 921 main.lock_sync [ pass ] 460 main.partition_innodb_semi_consistent [ pass ] 10162 main.mdl_sync [ pass ] 2193 main.crash_commit_before [ pass ] 372 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8 [ fail ] Test ended at 2026-04-22 13:58:28 CURRENT_TEST: main.ctype_utf8 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.result 2026-04-02 14:38:09.324657735 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.reject 2026-04-22 13:58:27.929506287 +0300 @@ -1567,10 +1567,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 40 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 40 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 40 const 4 Using where; Using index +1 SIMPLE t1 ref a a 40 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index @@ -5291,17 +5291,9 @@ # # as in the bug report. EXPLAIN output should still be pretty readable SET NAMES latin1; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ' AS u; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcd�\0081ÂÃÄÅ' AS `abcd�\0081ÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcd�\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` # Test normal utf8 SET NAMES utf8; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃ\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ` # # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT # @@ -5352,7 +5344,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 1 Using where; Using index SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5371,13 +5363,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -5421,7 +5413,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5444,7 +5436,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5473,14 +5465,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5571,7 +5563,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 1 Using where; Using index SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5590,13 +5582,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -5640,7 +5632,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5663,7 +5655,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5692,14 +5684,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5790,7 +5782,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 2 Using where SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5809,13 +5801,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -9420,8 +9412,6 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,a)=(10,'1e1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10 and `test`.`t1`.`a` = '1e1' DROP TABLE t1; # # MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1'; @@ -9447,13 +9437,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2) EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2,'x') DROP TABLE IF EXISTS t1; # # MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A'; @@ -9467,8 +9453,6 @@ SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`c` = 'A' DROP TABLE t1; # # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4 [ fail ] Test ended at 2026-04-22 13:58:30 CURRENT_TEST: main.ctype_utf8mb4 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.result 2026-04-02 14:38:09.325657732 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.reject 2026-04-22 13:58:29.612503594 +0300 @@ -1592,10 +1592,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 53 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 53 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 53 const 4 Using where; Using index +1 SIMPLE t1 ref a a 53 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4/' main.implicit_commit [ pass ] 344 main.ps_3innodb [ pass ] 461 main.strict [ pass ] 122 main.bootstrap [ pass ] 10927 main.multidelete_engine 'aria' [ pass ] 47 main.spatial_utility_function_collect 'aria' [ pass ] 36 main.vector 'aria' [ pass ] 271 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-34413-icp-reverse-order 'innodb' [ pass ] 663 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'innodb' [ pass ] 221 main.multidelete_engine 'innodb' [ pass ] 26 main.spatial_utility_function_collect 'innodb' [ pass ] 72 main.vector 'innodb' [ pass ] 863 main.multidelete_engine 'heap' [ pass ] 11 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-34413-icp-reverse-order 'myisam' [ pass ] 322 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'myisam' [ pass ] 102 main.multidelete_engine 'myisam' [ pass ] 6 main.spatial_utility_function_collect 'myisam' [ pass ] 39 main.vector 'myisam' [ pass ] 203 main.userstat [ pass ] 1154 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.group_min_max 'debug' [ fail ] Test ended at 2026-04-22 13:59:07 CURRENT_TEST: main.group_min_max --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.result 2026-04-17 18:40:40.421797574 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.reject 2026-04-22 13:59:06.655273610 +0300 @@ -1719,8 +1719,6 @@ explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 'a' and `test`.`t1`.`c` = 'i121' and `test`.`t1`.`a2` >= 'b' explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 Using where; Using index for group-by @@ -1736,8 +1734,6 @@ explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range NULL idx_t2_1 163 NULL 69 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`b` = 'a' and `test`.`t2`.`c` = 'i121' and `test`.`t2`.`a2` >= 'b' explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by @@ -1965,16 +1961,12 @@ explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`b` = 'c' and `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL idx_t1_2 147 NULL 512 Using where; Using index explain extended select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select 98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); count(distinct a1,a2,b) 4 @@ -2081,28 +2073,20 @@ where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 96.30 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 26.37 Using where; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select a1,a2,b,c from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 26.37 Using where; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 96.30 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index @@ -2125,13 +2109,9 @@ explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 392 100.00 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 392 100.00 Using where; Using index -Warnings: -Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` create table t4 as select distinct a1, a2, b, c from t1; alter table t4 add unique index idxt4 (a1, a2, b, c); # This is "superseded" by MDEV-7118, and Loose Index Scan is again an option: @@ -2412,7 +2392,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 EXPLAIN SELECT max(b), a FROM t1 GROUP BY a; @@ -2434,7 +2414,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -2447,7 +2427,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 16 +Handler_read_key 21 Handler_read_next 0 Handler_read_retry 0 EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION @@ -2464,7 +2444,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t1 range a a 5 NULL 6 Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; @@ -2486,8 +2466,7 @@ ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index -1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; @@ -2500,7 +2479,7 @@ INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 13 +Handler_read_key 23 Handler_read_next 0 Handler_read_retry 0 DELETE FROM t3; @@ -2509,14 +2488,14 @@ FROM t1 LIMIT 1; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; DELETE FROM t3 WHERE (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) > 10000; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -2679,8 +2658,6 @@ explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a,index a 5 NULL 1 100.00 Using where; Using index for group-by; Using temporary -Warnings: -Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a` drop table t1; CREATE TABLE t1 (a int, b int, c int, d int, KEY foo (c,d,a,b), KEY bar (c,a,b,d)); @@ -2891,7 +2868,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a <=> NULL; id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Select tables optimized away +x x x x x x x x x No matching min/max row SELECT MIN( a ) FROM t1 WHERE a <=> NULL; MIN( a ) NULL @@ -2927,7 +2904,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Select tables optimized away +x x x x x x x x x No matching min/max row SELECT MIN( a ) FROM t1 WHERE a IS NULL; MIN( a ) NULL @@ -3312,8 +3289,6 @@ SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref b b 4 const 1 Using where; Using index -Warnings: -Note 1105 Cannot use key `b` part[1] for lookup: `test`.`t1`.`a` of type `varchar` > "'0' = 'z'" of type `boolean` SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; b min(a) explain @@ -3367,7 +3342,7 @@ EXPLAIN SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range NULL b 10 NULL 3 Using where; Using index for group-by +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; MIN(a) b @@ -3861,8 +3836,6 @@ 1 PRIMARY ALL distinct_key NULL NULL NULL 5 100.00 1 PRIMARY t1_outer ref a a 5 .max(b) 7 100.00 Using index 2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by -Warnings: -Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = ``.`max(b)` set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set @@use_stat_tables=@save_use_stat_tables; explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a); @@ -3870,8 +3843,6 @@ 1 PRIMARY ALL distinct_key NULL NULL NULL 5 100.00 1 PRIMARY t1_outer ref a a 5 .max(b) 7 100.00 Using index 2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by -Warnings: -Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = ``.`max(b)` drop table t1; # # End of 10.0 tests @@ -4020,18 +3991,12 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "DATE'2001-01-04'" of type `date` EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "DATE'2001-01-04'" of type `date` EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "('2001-01-04')" of type `date` DROP TABLE t1; # # MIN() optimization didn't work correctly with BETWEEN when using too @@ -4041,7 +4006,7 @@ insert into t1 values("bar"),("Cafe"); explain select min(a) from t1 where a between "a" and "Cafe2"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row explain select min(a) from t1 where a between "a" and "Cafeeeeeeeeeeeeeeeeeeeeeeeeee"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 13 NULL 2 Using where; Using index Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_min_max-debug/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_min_max-debug/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'c' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain [ fail ] Test ended at 2026-04-22 13:59:14 CURRENT_TEST: main.show_explain --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.result 2026-04-17 18:40:40.488801714 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.reject 2026-04-22 13:59:14.195430969 +0300 @@ -59,10 +59,6 @@ select max(c) from t1 where a < 10; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 10 Using index condition -Warnings: -Note 1003 select max(c) from t1 where a < 10 connection con1; max(c) 9 @@ -83,10 +79,6 @@ explain select max(c) from t1 where a < 10; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan -Warnings: -Note 1003 explain select max(c) from t1 where a < 10 connection con1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan @@ -275,17 +267,7 @@ update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -321,17 +303,7 @@ delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -377,23 +349,8 @@ select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 connection con1; a SUBQ 0 0 @@ -526,8 +483,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a` set @show_explain_probe_select_id=1; SET debug_dbug='+d,show_explain_probe_join_exec_end'; EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; @@ -639,7 +594,7 @@ WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 0 Using where 2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @show_explain_probe_select_id=1; @@ -1264,10 +1219,6 @@ ('ESP','Spanish'),('FRA','French'),('VNM','Vietnamese'); explain SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 system NULL NULL NULL NULL 1 -1 SIMPLE t1 index b b 15 NULL 107 Using where; Using index -1 SIMPLE t3 ref PRIMARY PRIMARY 14 test.t1.b 1 Using index set @show_explain_probe_select_id=1; SET debug_dbug='+d,show_explain_probe_do_select'; SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; @@ -1298,7 +1249,7 @@ SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 20 3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where set @show_explain_probe_select_id=1; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.show_explain/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.show_explain/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sql_safe_updates [ pass ] 101 main.enforce_storage_engine_opt [ pass ] 53 main.log_state_bug33693 [ pass ] 18 ^[[Fmain.log_tables-big [ pass ] 163039 main.mysql_client_test [ pass ] 37517 main.mysql_client_test_nonblock [ pass ] 36573 main.log_tables [ pass ] 15285 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_mat_cost [ fail ] Test ended at 2026-04-22 14:03:36 CURRENT_TEST: main.subselect_mat_cost --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.result 2026-04-02 14:38:09.484657302 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.reject 2026-04-22 14:03:36.554962987 +0300 @@ -501,7 +501,7 @@ 1 PRIMARY City ALL Country NULL NULL NULL 4079 Using temporary; Using filesort 1 PRIMARY Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using index 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 5.934845 +Last_query_cost 0.024323 EXPLAIN SELECT straight_join City.Name, City.Population FROM Country JOIN City ON City.Country = Country.Code @@ -511,7 +511,7 @@ 1 PRIMARY Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort 1 PRIMARY City ref Country Country 3 world.Country.Code 17 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 7.972473 +Last_query_cost 0.024323 EXPLAIN SELECT City.Name, City.Population FROM Country LEFT JOIN City ON City.Country = Country.Code @@ -521,7 +521,7 @@ 1 PRIMARY Country index NULL PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort 1 PRIMARY City ref Country Country 3 world.Country.Code 17 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 7.972473 +Last_query_cost 0.024323 SELECT City.Name, City.Population FROM City JOIN Country ON City.Country = Country.Code GROUP BY City.Name Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat_cost/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat_cost/' main.log_state [ pass ] 16497 main.create_or_replace [ pass ] 326 main.mysql_upgrade-6984 [ pass ] 2460 main.innodb_load_xa [ skipped ] Need InnoDB plugin main.innodb_ignore_builtin [ pass ] 13 main.init_file [ pass ] 11 main.init_file_longline_3816 [ pass ] 31 ReplayTest: Loading context main.init_connection_query_cache [ fail ] Test ended at 2026-04-22 14:04:00 CURRENT_TEST: main.init_connection_query_cache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/init_connection_query_cache.result 2026-04-02 14:38:09.377657591 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/init_connection_query_cache.reject 2026-04-22 14:04:00.277917913 +0300 @@ -14,8 +14,6 @@ explain extended select * from test.t1 where 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 connection default; disconnect con1; revoke all privileges, grant option from mysqltest1@localhost; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.init_connection_query_cache/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.init_connection_query_cache/' main.init_connect [ pass ] 112 main.ctype_utf8mb4_0900_mem [ pass ] 50 main.delayed_blob [ pass ] 34 main.mysql_upgrade [ skipped ] cannot test minor upgrade for previews ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.join_cache [ fail ] Test ended at 2026-04-22 14:04:22 CURRENT_TEST: main.join_cache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.result 2026-04-17 18:40:40.431798192 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.reject 2026-04-22 14:04:22.391875563 +0300 @@ -459,8 +459,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where -1 SIMPLE City hash_index_merge City_Population,City_Name #hash#$hj:City_Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(City_Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # After Analyze, Query 4 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -861,8 +860,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=3, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -939,8 +937,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=3, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -1069,8 +1066,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -1147,8 +1143,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -1271,8 +1266,7 @@ ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 52 NULL # Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code # Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 10 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1301,8 +1295,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 52 NULL 17 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, City_Name, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1339,8 +1332,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1413,8 +1405,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1536,8 +1527,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1610,8 +1600,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1733,8 +1722,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1807,8 +1795,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1930,8 +1917,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2004,8 +1990,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2131,8 +2116,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2205,8 +2189,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2235,8 +2218,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2309,8 +2291,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2339,8 +2320,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2413,8 +2393,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2443,8 +2422,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2517,8 +2495,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2547,8 +2524,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2621,8 +2597,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2651,8 +2626,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2725,8 +2699,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2958,8 +2931,7 @@ ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 302 NULL 15 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code 24 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -2967,8 +2939,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 302 NULL 15 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set @@use_stat_tables=@save_use_stat_tables; set @@join_cache_level=@save_join_cache_level; @@ -3755,8 +3726,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 1 -1 SIMPLE t4 ref idx idx 5 test.t1.c 1 1 SIMPLE t3 ref idx idx 5 test.t1.d 1 +1 SIMPLE t4 ref idx idx 5 test.t1.c 1 select t1.a, t1.b, t1.c, t1.d, t2.e, t3.f, t4.g from t1,t2,t3,t4 where t2.b=t1.b and t3.d=t1.d and t4.c=t1.c; a b c d e f g @@ -3768,8 +3739,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE t4 ref idx idx 5 test.t1.c 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t3 ref idx idx 5 test.t1.d 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t4 ref idx idx 5 test.t1.c 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan select t1.a, t1.b, t1.c, t1.d, t2.e, t3.f, t4.g from t1,t2,t3,t4 where t2.b=t1.b and t3.d=t1.d and t4.c=t1.c; a b c d e f g @@ -3917,8 +3888,7 @@ FROM t1 STRAIGHT_JOIN t2 ORDER BY t1.int_key; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL int_key 4 NULL 14 Using index -1 SIMPLE t2 index NULL int_key 4 NULL 2 Using index; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row DROP TABLE t1,t2; SET join_cache_level=@save_join_cache_level; @@ -3954,8 +3924,7 @@ FROM t1 JOIN t2 ON t2.v ORDER BY t2.v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row DROP TABLE t1,t2; # @@ -4865,8 +4834,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4887,8 +4854,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4909,8 +4874,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -6038,8 +6001,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Start temporary 1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 10.00 Using where; Using join buffer (flat, BNLH join) 1 PRIMARY t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 10.00 Using index; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`temp`.`f2` = `test`.`t1`.`v1` and `test`.`t2`.`v1` = `test`.`t1`.`v1` DROP TABLE t1,t2,temp; set join_cache_level=@save_join_cache_level; # @@ -6059,7 +6020,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 UNCACHEABLE SUBQUERY t3 system NULL NULL NULL NULL 1 +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE select count(*) from t1 straight_join t2 where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1); count(*) @@ -6114,8 +6075,6 @@ # - table db accessed with hash_ALL: explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.db WHERE Select_priv = PAGE_FAULTS_MINOR; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set join_cache_level=@save_join_cache_level; create table t1 (c1 date not null, key (c1)) engine=innodb; insert t1 values ('2017-12-27'); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.statistics_json [ fail ] Test ended at 2026-04-22 14:04:27 CURRENT_TEST: main.statistics_json --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.result 2026-04-17 18:40:40.504802702 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.reject 2026-04-22 14:04:27.213866287 +0300 @@ -4504,9 +4504,7 @@ 00000000000000000000711C711C711C711C711CE338E338E338E338E33855555555555555555555C671C671C671C671C671388E388E388E388E388EAAAAAAAAAAAAAAAAAAAA1BC71BC71BC71BC71BC78DE38DE38DE38DE38DE3FFFFFFFFFFFFFFFFFFFF explain extended select * from t1_bin where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 58.82 Using where -Warnings: -Note 1003 select `test`.`t1_bin`.`a` AS `a` from `test`.`t1_bin` where `test`.`t1_bin`.`a` between 'a-3a' and 'zzzzzzzzz' +1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 10.00 Using where analyze select * from t1_bin where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 10.00 58.82 60.00 Using where @@ -4580,16 +4578,12 @@ explain extended select * from t1_json where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` between 'a-3a' and 'zzzzzzzzz' analyze select * from t1_json where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00 60.00 60.00 Using where explain extended select * from t1_json where a < 'b-1a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` < 'b-1a' analyze select * from t1_json where a > 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00 0.00 0.00 Using where @@ -4600,16 +4594,12 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. UPDATE mysql.column_stats SET histogram='{"histogram_hb":"not-histogram"}' WHERE table_name='t1_json'; FLUSH TABLES; explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. UPDATE mysql.column_stats SET histogram='{"histogram_hb":["not-a-bucket"]}' WHERE table_name='t1_json'; @@ -4617,8 +4607,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"no-expected-members":1}]}' WHERE table_name='t1_json'; @@ -4626,8 +4614,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":{}}]}' WHERE table_name='t1_json'; @@ -4635,8 +4621,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: String or number expected at offset 27. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":"not-an-integer"}]}' WHERE table_name='t1_json'; @@ -4644,8 +4628,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":0.25}]}' WHERE table_name='t1_json'; @@ -4653,8 +4635,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":0.25, "ndv":1}]}' WHERE table_name='t1_json'; @@ -4669,8 +4649,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Histogram must have at least one bucket at offset 19. create table t2 ( city varchar(100) ); @@ -4685,24 +4663,18 @@ explain extended select * from t2 where city = 'Moscow'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 98.02 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` = 'Moscow' analyze select * from t2 where city = 'Moscow'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 98.02 98.02 Using where explain extended select * from t2 where city = 'Helsinki'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 1.98 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` = 'Helsinki' analyze select * from t2 where city = 'helsinki'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 1.98 1.98 Using where explain extended select * from t2 where city < 'Lagos'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 1.98 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` < 'Lagos' drop table t1_bin; drop table t1_json; drop table t2; @@ -7904,28 +7876,18 @@ explain extended select * from t1 where col1 < 'а'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'а' explain extended select * from t1 where col1 < 'в'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 20.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'в' explain extended select * from t1 where col1 < 'д'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'д' explain extended select * from t1 where col1 < 'ж'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'ж' explain extended select * from t1 where col1 < 'й'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 90.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'й' delete from t1; insert into t1 values ('"а'),('"б'),('"в'),('"г'),('"д'),('"е'),('"ж'),('"з'),('"и'),('"й'); @@ -8006,28 +7968,18 @@ explain extended select * from t1 where col1 < '"а'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"а' explain extended select * from t1 where col1 < '"в'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 20.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"в' explain extended select * from t1 where col1 < '"д'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"д' explain extended select * from t1 where col1 < '"ж'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"ж' explain extended select * from t1 where col1 < '"й'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 90.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"й' drop table t1; select JSON_UNQUOTE(CONVERT('"ФФ"' using cp1251)); JSON_UNQUOTE(CONVERT('"ФФ"' using cp1251)) Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.statistics_json/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.statistics_json/' ***Warnings generated in error logs during shutdown after running tests: main.statistics_json 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: String or number expected at offset 27. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Histogram must have at least one bucket at offset 19. main.analyze_engine_stats2 [ pass ] 2952 main.analyze_stmt_prefetch_count [ pass ] 2429 main.host_cache_size_functionality [ pass ] 1466 main.long_unique_innodb [ pass ] 8215 main.insert_debug [ pass ] 63 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'off,unoptimized' [ fail ] Test ended at 2026-04-22 14:04:55 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 14:04:54.562813404 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'on,unoptimized' [ fail ] Test ended at 2026-04-22 14:04:59 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.result~ 2026-04-22 14:04:55.222812122 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.reject 2026-04-22 14:04:59.219804354 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +495,7 @@ select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index +1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where drop table t1,t2,t3; # # Bug mdev-4340: performance regression with extended_keys=on Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-on,unoptimized/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-on,unoptimized/' main.mdev-25830 'unoptimized' [ pass ] 55 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'covering,off' [ fail ] Test ended at 2026-04-22 14:05:05 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 14:05:04.933793233 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'covering,on' [ fail ] Test ended at 2026-04-22 14:05:10 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.result~ 2026-04-22 14:05:05.574267786 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.reject 2026-04-22 14:05:09.627784083 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +495,7 @@ select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index +1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where drop table t1,t2,t3; # # Bug mdev-4340: performance regression with extended_keys=on Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,on/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,on/' main.mdev-25830 'covering' [ pass ] 92 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.rowid_filter_innodb 'normal' [ fail ] Test ended at 2026-04-22 14:05:20 CURRENT_TEST: main.rowid_filter_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.result 2026-04-17 18:40:40.482801343 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.reject 2026-04-22 14:05:19.817764176 +0300 @@ -2435,8 +2435,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const # # 1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index -Warnings: -Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1 drop table t1, t2; # # MDEV-19820: use of rowid filter for innodb table without primary key @@ -2456,8 +2454,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2472,8 +2468,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2511,8 +2505,6 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; a 1 @@ -2527,15 +2519,11 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update EXPLAIN EXTENDED SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter 1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update SET @saved_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,innodb_report_deadlock'; SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; @@ -2587,9 +2575,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2610,9 +2595,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`ch` = `test`.`t2`.`ch2` and `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2650,8 +2632,6 @@ where id=15066 and (match s against ('+"fttest"' in boolean mode)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 fulltext id,s s 0 1 1.64 Using where -Warnings: -Note 1003 select count(0) AS `count(0)` from `test`.`t1` where `test`.`t1`.`id` = 15066 and (match `test`.`t1`.`s` against ('+"fttest"' in boolean mode)) select count(0) from t1 where id=15066 and (match s against ('+"fttest"' in boolean mode)); count(0) @@ -2963,8 +2943,6 @@ ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1; # @@ -3002,16 +2980,12 @@ WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter a,b b|a 5|5 NULL 192 (21%) 21.31 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) @@ -3554,9 +3528,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where 2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond((`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) SELECT * FROM t1 WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.rowid_filter_innodb 'ahi' [ fail ] Test ended at 2026-04-22 14:05:28 CURRENT_TEST: main.rowid_filter_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb,ahi.result~ 2026-04-22 14:05:20.472762894 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb,ahi.reject 2026-04-22 14:05:28.481747204 +0300 @@ -2435,8 +2435,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const # # 1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index -Warnings: -Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1 drop table t1, t2; # # MDEV-19820: use of rowid filter for innodb table without primary key @@ -2456,8 +2454,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2472,8 +2468,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2511,8 +2505,6 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; a 1 @@ -2527,15 +2519,11 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update EXPLAIN EXTENDED SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter 1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update SET @saved_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,innodb_report_deadlock'; SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; @@ -2587,9 +2575,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2610,9 +2595,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`ch` = `test`.`t2`.`ch2` and `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2650,8 +2632,6 @@ where id=15066 and (match s against ('+"fttest"' in boolean mode)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 fulltext id,s s 0 1 1.64 Using where -Warnings: -Note 1003 select count(0) AS `count(0)` from `test`.`t1` where `test`.`t1`.`id` = 15066 and (match `test`.`t1`.`s` against ('+"fttest"' in boolean mode)) select count(0) from t1 where id=15066 and (match s against ('+"fttest"' in boolean mode)); count(0) @@ -2963,8 +2943,6 @@ ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1; # @@ -3002,16 +2980,12 @@ WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter a,b b|a 5|5 NULL 192 (21%) 21.31 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) @@ -3554,9 +3528,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where 2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond((`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) SELECT * FROM t1 WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-ahi/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-ahi/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_innodb_notembedded [ fail ] Test ended at 2026-04-22 14:05:30 CURRENT_TEST: main.selectivity_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.reject 2026-04-22 14:05:30.279743677 +0300 @@ -74,16 +74,7 @@ select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel from information_schema.optimizer_trace; sel -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.035714283 - } - ] -] +NULL set optimizer_trace=@tmp; drop table t0,t1,t10; set histogram_size=@save_histogram_size; @@ -127,7 +118,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -139,14 +130,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col0", - "ranges": - ["1 < col0"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL $query_tbl; EXPLAIN { @@ -161,7 +145,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -173,14 +157,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL # # Check if not being able to infer anything for the first MAX_KEY # columns doesn't prevent further inferences. @@ -202,7 +179,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 99.60784149, + "filtered": 99.21875, "attached_condition": "(t1.col1 > 1 or t1.col2 > 1 or t1.col3 > 1 or t1.col4 > 1 or t1.col5 > 1 or t1.col6 > 1 or t1.col7 > 1 or t1.col8 > 1 or t1.col9 > 1 or t1.col10 > 1 or t1.col11 > 1 or t1.col12 > 1 or t1.col13 > 1 or t1.col14 > 1 or t1.col15 > 1 or t1.col16 > 1 or t1.col17 > 1 or t1.col18 > 1 or t1.col19 > 1 or t1.col20 > 1 or t1.col21 > 1 or t1.col22 > 1 or t1.col23 > 1 or t1.col24 > 1 or t1.col25 > 1 or t1.col26 > 1 or t1.col27 > 1 or t1.col28 > 1 or t1.col29 > 1 or t1.col30 > 1 or t1.col31 > 1 or t1.col32 > 1 or t1.col33 > 1 or t1.col34 > 1 or t1.col35 > 1 or t1.col36 > 1 or t1.col37 > 1 or t1.col38 > 1 or t1.col39 > 1 or t1.col40 > 1 or t1.col41 > 1 or t1.col42 > 1 or t1.col43 > 1 or t1.col44 > 1 or t1.col45 > 1 or t1.col46 > 1 or t1.col47 > 1 or t1.col48 > 1 or t1.col49 > 1 or t1.col50 > 1 or t1.col51 > 1 or t1.col52 > 1 or t1.col53 > 1 or t1.col54 > 1 or t1.col55 > 1 or t1.col56 > 1 or t1.col57 > 1 or t1.col58 > 1 or t1.col59 > 1 or t1.col60 > 1 or t1.col61 > 1 or t1.col62 > 1 or t1.col63 > 1 or t1.col64 > 1 or t1.col65 > 1 or t1.col66 > 1 or t1.col67 > 1 or t1.col68 > 1 or t1.col69 > 1 or t1.col70 > 1 or t1.col71 > 1 or t1.col72 > 1 or t1.col73 > 1 or t1.col74 > 1 or t1.col75 > 1 or t1.col76 > 1 or t1.col77 > 1 or t1.col78 > 1 or t1.col79 > 1 or t1.col80 > 1 or t1.col81 > 1 or t1.col82 > 1 or t1.col83 > 1 or t1.col84 > 1 or t1.col85 > 1 or t1.col86 > 1 or t1.col87 > 1 or t1.col88 > 1 or t1.col89 > 1 or t1.col90 > 1 or t1.col91 > 1 or t1.col92 > 1 or t1.col93 > 1 or t1.col94 > 1 or t1.col95 > 1 or t1.col96 > 1 or t1.col97 > 1 or t1.col98 > 1 or t1.col99 > 1 or t1.col100 > 1 or t1.col101 > 1 or t1.col102 > 1 or t1.col103 > 1 or t1.col104 > 1 or t1.col105 > 1 or t1.col106 > 1 or t1.col107 > 1 or t1.col108 > 1 or t1.col109 > 1 or t1.col110 > 1 or t1.col111 > 1 or t1.col112 > 1 or t1.col113 > 1 or t1.col114 > 1 or t1.col115 > 1 or t1.col116 > 1 or t1.col117 > 1 or t1.col118 > 1 or t1.col119 > 1 or t1.col120 > 1 or t1.col121 > 1 or t1.col122 > 1 or t1.col123 > 1 or t1.col124 > 1 or t1.col125 > 1 or t1.col126 > 1 or t1.col127 > 1 or t1.col128 > 1 or t1.col129 > 1 or t1.col130 > 1 or t1.col131 > 1 or t1.col132 > 1 or t1.col133 > 1 or t1.col134 > 1 or t1.col135 > 1 or t1.col136 > 1 or t1.col137 > 1 or t1.col138 > 1 or t1.col139 > 1 or t1.col140 > 1 or t1.col141 > 1 or t1.col142 > 1 or t1.col143 > 1 or t1.col144 > 1 or t1.col145 > 1 or t1.col146 > 1 or t1.col147 > 1 or t1.col148 > 1 or t1.col149 > 1 or t1.col150 > 1 or t1.col151 > 1 or t1.col152 > 1 or t1.col153 > 1 or t1.col154 > 1 or t1.col155 > 1 or t1.col156 > 1 or t1.col157 > 1 or t1.col158 > 1) and t1.col159 > 1" } } @@ -214,16 +191,7 @@ from information_schema.optimizer_trace; JS -[ - [ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } - ] -] +NULL set optimizer_trace=@trace_tmp; drop table t1; # @@ -260,14 +228,7 @@ from opt_trace; JS -[ - [ - { - "index_name": "PRIMARY", - "selectivity_from_index": 0.005 - } - ] -] +NULL # Must not include 1.79...e308 as cost: select json_detailed(json_extract(trace,'$**.best_access_path')) as JS @@ -276,7 +237,7 @@ JS [ { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -284,22 +245,21 @@ "considered_access_paths": [ { - "access_type": "range", - "range_index": "PRIMARY", - "rows": 5, - "rows_after_filter": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true } ], "chosen_access_method": { - "type": "range", - "index": "PRIMARY", - "rows_read": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.costs [ fail ] Test ended at 2026-04-22 14:05:39 CURRENT_TEST: main.costs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.result 2026-04-17 18:40:40.367794237 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.reject 2026-04-22 14:05:39.397725763 +0300 @@ -7,87 +7,87 @@ explain select sum(e) as "table_scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 -Last_query_cost 0.012556 +Last_query_cost 0.024323 explain select sum(a) as "index scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Range scans should be used if we don't examine all rows in the table # explain select count(a) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Last_query_cost 0.000000 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index -Last_query_cost 0.002747 +Last_query_cost 0.024323 # # Shorter indexes are preferred over longer indexes # explain select sum(a+b) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL ba 9 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 explain select count(*) from t1 where b between 5 and 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index -Last_query_cost 0.002097 +Last_query_cost 0.024323 explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' explain select count(*) from t1 where b > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 explain select count(*) from t1 where d > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 # # Check covering index usage # explain select a,b,c from t1 where a=b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Prefer ref keys over ranges # explain select count(*) from t1 where b=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=2 and c=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda,cba,cb cba 10 const,const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=3 and c between 3 and 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # # Prefer eq keys over ref keys # explain select a,b,e from t1 where a=10 or a=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition -Last_query_cost 0.003126 +Last_query_cost 0.024323 explain select a,b,e from t1 where d=10 or d=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 2 Using index condition -Last_query_cost 0.003291 +Last_query_cost 0.024323 drop table t1; # # MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in @@ -120,8 +120,6 @@ KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) ) ENGINE= InnoDB; explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range l_suppkey l_suppkey 10 NULL 1 Using where; Using index drop table t1; set global InnoDB.optimizer_disk_read_ratio=@save; # @@ -153,48 +151,5 @@ b >= date '1993-06-01' and b < date '1993-06-01' + interval '3' month and exists (select * from t2 where e = t1.a and g < h) group by c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 12.53886553, - "filesort": { - "sort_key": "t1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["PRIMARY", "t1_ix1"], - "loops": 1, - "rows": 7000, - "cost": 1.1518548, - "filtered": 100, - "attached_condition": "t1.b >= DATE'1993-06-01' and t1.b < (DATE'1993-06-01' + interval '3' month)" - } - }, - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["e"], - "ref": ["test.t1.a"], - "loops": 7000, - "rows": 1, - "cost": 6.7528092, - "filtered": 100, - "attached_condition": "t2.g < t2.h", - "first_match": "t1" - } - } - ] - } - } - } -} set max_heap_table_size=@save_mhts; drop table t1, t2; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.delete_innodb [ fail ] Test ended at 2026-04-22 14:05:49 CURRENT_TEST: main.delete_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_innodb.result 2026-04-02 14:38:09.331657716 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_innodb.reject 2026-04-22 14:05:48.819707203 +0300 @@ -16,9 +16,6 @@ a b EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a ALL NULL NULL NULL NULL 3 -1 SIMPLE b ALL NULL NULL NULL NULL 3 DELETE b FROM t1 AS a JOIN t1 AS b; SELECT * FROM t1; c1 @@ -129,81 +126,11 @@ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and @@ -227,81 +154,11 @@ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and @@ -378,81 +235,11 @@ o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation @@ -476,81 +263,11 @@ o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation @@ -600,9 +317,6 @@ 114 # lineitem should be first and with "Using rowid filter" explain delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using where; Using rowid filter -1 SIMPLE second ref s_receiptDATE s_receiptDATE 4 func 1 Using where; Using index delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); # Should be 0 select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete_innodb/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.opt_hints_join_order [ fail ] Test ended at 2026-04-22 14:05:50 CURRENT_TEST: main.opt_hints_join_order --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_join_order.result 2026-04-17 18:40:40.455799675 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_join_order.reject 2026-04-22 14:05:50.065704746 +0300 @@ -30,180 +30,61 @@ # Warning expected: hint must be ignored as malformed (no table names) EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX()*/ count(*) FROM t1, t2; -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 4224 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; -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 4224 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 SELECT /*+ JOIN_FIXED_ORDER(t2)*/ count(*) FROM t1, t2; -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 4224 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 SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qb1)*/ count(*) FROM t2, t1; -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: -Note 1003 select /*+ QB_NAME(`qb1`) JOIN_FIXED_ORDER(@`qb1`) */ straight_join count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` # Invalid QB name for the fixed order EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qb3)*/ count(*) FROM t2, t1; -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 4220 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; -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: -Note 1003 select /*+ JOIN_FIXED_ORDER(@`select#1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # JOIN_FIXED_ORDER() cannot be combined with other join order hints EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2) JOIN_FIXED_ORDER()*/ count(*) FROM t1, t2; -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 4219 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; -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 4219 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 SELECT /*+ JOIN_PREFIX(t1) JOIN_PREFIX(t2)*/ count(*) FROM t1, t2; -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 4219 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; -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 4219 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 SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2,t1) JOIN_ORDER(@q1 t3,t2)*/ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`,`t1`) JOIN_ORDER(@`q1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Variation of last syntax EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2@q1, t1) JOIN_ORDER(t3, t2@q1)*/ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`@`q1`,`t1`) JOIN_ORDER(@`q1` `t3`,`t2`@`q1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Invalid mix of notations EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1 t2, t1@q1)*/ count(*) FROM t1, t2, t3; -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 t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 1064 Optimizer hint syntax error near '@q1)*/ count(*) -FROM t1, t2, t3' at line 2 -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Hint is correct EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(t1@qb1, t2)*/ count(*) FROM t1, t2; -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: -Note 1003 select /*+ QB_NAME(`qb1`) JOIN_SUFFIX(@`qb1` `t1`@`qb1`,`t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_PREFIX(@qb1, t2)*/ count(*) FROM t1, t2; -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 1064 Optimizer hint syntax error near ', t2)*/ count(*) FROM t1, t2' at line 2 -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Invalid table name EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t3)*/ count(*) FROM t1, t2; -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 4221 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 SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(@qbXXX t1)*/ count(*) FROM t1, t2; -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 4220 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; -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 4221 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; -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 4220 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 EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2@subq)*/ (SELECT /*+ QB_NAME(subq)*/ max(f1) FROM t2) as SQ, f1 FROM t2; -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 4221 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 # the maximum, will produce a warning. Usually so many hints will conflict @@ -235,45 +116,6 @@ JOIN_ORDER(t2,t1) JOIN_ORDER(t3,t2) JOIN_ORDER(t2,t1) JOIN_ORDER(t3,t2) JOIN_ORDER(t1,t2,t3,t4,t5,t6) */ count(*) FROM t1, t2, t3; -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) -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 4219 Hint JOIN_ORDER(`t1`,`t2`,`t3`,`t4`,`t5`,`t6`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_SUFFIX(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 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 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -281,14 +123,6 @@ 10 explain extended SELECT count(*) FROM t1 JOIN t2 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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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: -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` # Check name resolving SELECT /*+ QB_NAME(q1) JOIN_PREFIX(t3, t2, t2@subq2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t2) AND @@ -298,15 +132,6 @@ explain extended SELECT /*+ QB_NAME(q1) JOIN_PREFIX(t3, t2, t2@subq2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t2) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t2); -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 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t2.f1 20 5.00 Using where; FirstMatch(t2); Using join buffer (incremental, BNLH join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 20 100.00 -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_PREFIX(@`q1` `t3`,`t2`,`t2`@`subq2`) */ count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2`) join `test`.`t2` join `test`.`t3` where `test`.`t2`.`f1` = `test`.`t2`.`f1` # Check conflicting hints # Second JOIN_PREFIX is conflicting SELECT /*+ JOIN_PREFIX(t3, t2, t1) JOIN_PREFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -319,16 +144,6 @@ 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); -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 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -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 4219 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 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -340,15 +155,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4219 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(*) FROM t1 JOIN t2 JOIN t3 @@ -360,14 +166,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (flat, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) JOIN_ORDER(@`select#1` `t1`,`t2`,`t5`@`subq2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # Unresolved table name t7 in JOIN_ORDER hint, hint ignored SELECT /*+ JOIN_ORDER(t1, t7, t5) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -379,15 +177,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4221 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) JOIN_ORDER(t4@subq1, t3) JOIN_SUFFIX(t1) */ count(*) @@ -401,14 +190,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`) JOIN_ORDER(@`select#1` `t4`@`subq1`,`t3`) JOIN_SUFFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # Second JOIN_ORDER is ignored 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) @@ -420,15 +201,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4219 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 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -440,15 +212,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4219 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 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -460,15 +223,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4219 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(*) FROM t1 JOIN t2 JOIN t3 @@ -480,14 +234,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t4`@`subq1`,`t3`) JOIN_SUFFIX(@`select#1` `t1`) JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_PREFIX with all tables. SELECT /*+ JOIN_PREFIX(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -499,14 +245,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_SUFFIX with all tables. SELECT /*+ JOIN_SUFFIX(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -518,14 +256,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_ORDER with all tables. SELECT /*+ JOIN_ORDER(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -537,14 +267,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_PREFIX, JOIN_ORDER, JOIN_SUFFIX with all tables. SELECT /*+ JOIN_SUFFIX(t2, t5@subq2, t4@subq1, t3, t1) JOIN_ORDER(t2, t5@subq2, t4@subq1, t3, t1) @@ -560,14 +282,6 @@ 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); -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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_ORDER is ignored due to STRAIGHT_JOIN. SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2, t1) */ STRAIGHT_JOIN count(*) FROM t1 JOIN t2 JOIN t3 @@ -581,15 +295,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -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 4219 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 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -599,14 +304,6 @@ explain extended SELECT /*+ QB_NAME(q1) JOIN_FIXED_ORDER(@q1) */ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -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: -Note 1003 /* select#1 */ select /*+ QB_NAME(`q1`) JOIN_FIXED_ORDER(@`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`)))) SELECT /*+ JOIN_FIXED_ORDER() */ 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); @@ -615,14 +312,6 @@ explain extended SELECT /*+ JOIN_FIXED_ORDER() */ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -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: -Note 1003 /* select#1 */ select /*+ JOIN_FIXED_ORDER(@`select#1`) */ 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`)))) SELECT /*+ QB_NAME(q1) */ 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); @@ -631,14 +320,6 @@ explain extended SELECT /*+ QB_NAME(q1) */ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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: -Note 1003 select /*+ QB_NAME(`q1`) */ 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` # Testing STRAIGHT_JOIN SELECT count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -646,14 +327,6 @@ 10 explain extended SELECT 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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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: -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` # t3 can not be first 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); @@ -663,15 +336,6 @@ Warning 4219 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 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -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 4219 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 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -679,15 +343,6 @@ 10 explain extended SELECT /*+ JOIN_PREFIX(t1, t2, t3) */ 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 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -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: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`,`t2`,`t3`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t5`.`f1` = `test`.`t2`.`f1` # Hint is applicable SELECT /*+ JOIN_SUFFIX(t4, t5) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -695,14 +350,6 @@ 10 explain extended SELECT /*+ JOIN_SUFFIX(t4, t5) */ 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 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t3); Using join buffer (incremental, BNLH join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t4`,`t5`) */ 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`.`t5`.`f1` = `test`.`t2`.`f1` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_ORDER(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -714,14 +361,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (flat, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`,`t3`,`t1`) */ 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` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -733,15 +372,6 @@ 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); -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 -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -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: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_PREFIX(@`q1` `t2`,`t3`,`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` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_SUFFIX(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -753,14 +383,6 @@ 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); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (flat, 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) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_SUFFIX(@`q1` `t2`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` DROP TABLE t1, t2, t3, t4 ,t5, t6; # Testing embedded join CREATE TABLE t1 (f1 INT); @@ -771,78 +393,30 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -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 4219 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 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t1 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: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t1`,`t4`) */ 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(t4, t1, t2) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t4`,`t1`,`t2`) */ 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(t3, t4) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -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: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t4`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN SELECT /*+ JOIN_ORDER(t4, t3) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join) EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t1) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t1`) */ 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_SUFFIX(t2, t1) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -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 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t1`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 DROP TABLE t1, t2, t3, t4; CREATE TABLE t1 ( @@ -873,79 +447,31 @@ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -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: -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 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta2) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta2`) */ 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 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta1, ta2) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -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 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta1`,`ta2`) */ 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 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta2, ta1) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta2`,`ta1`) */ 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 # Hint should be ignored EXPLAIN EXTENDED DELETE /*+ JOIN_SUFFIX(ta2, t3, ta1) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -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 4219 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) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -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 4219 Hint JOIN_PREFIX(`ta1`,`t2`,`t3`) is ignored as conflicting/duplicated -Warning 4219 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. # Note: Const tables are excluded from the process of dependency setting @@ -957,17 +483,7 @@ CREATE TABLE t2(f1 INT) ENGINE=InnoDB; INSERT INTO t2 VALUES (1); EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t1, t2) */ 1 FROM t1 JOIN t2 ON t1.f1 = t2.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`,`t2`) */ 1 AS `1` from `test`.`t2` where `test`.`t2`.`f1` = 1 EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2, t1) */ 1 FROM t1 JOIN t2 ON t1.f1 = t2.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) */ 1 AS `1` from `test`.`t2` where `test`.`t2`.`f1` = 1 DROP TABLE t1, t2; # # Bug#23144274 WL9158:ASSERTION `JOIN->BEST_READ < DOUBLE(1.79769313486231570815E+308L)' FAILED @@ -990,11 +506,6 @@ test.t2 analyze status OK EXPLAIN SELECT /*+ JOIN_SUFFIX(t1, t2) */ t2.f3 FROM t2 LEFT JOIN t1 ON t2.f1 = t1.f1 WHERE t1.f2 NOT LIKE ('FMGAU') OR t2.f2 > 't'; -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 4219 Hint JOIN_SUFFIX(`t1`,`t2`) is ignored as conflicting/duplicated DROP TABLE t1, t2; CREATE TABLE t1 ( @@ -1025,23 +536,9 @@ EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t2, t3) JOIN_ORDER(t1, t2) */ t3.f1 FROM ( t2 INNER JOIN t3 ON t3.f2 = t2.f2 LEFT JOIN t1 ON t1.f1 = t3.f1 ) WHERE NOT (t2.f1 >= 7); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 range f2,f1 f1 5 NULL 1 100.00 Using index condition -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 4219 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 ) WHERE NOT (t2.f1 >= 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 -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 4219 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 ( f1 INT(11) NOT NULL AUTO_INCREMENT, @@ -1053,12 +550,6 @@ PRIMARY KEY (f1) ); EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t1, t1) */ t2.f1 FROM t1 JOIN t2 ON t1.f2 = t2.f1; -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 4219 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 ( @@ -1096,12 +587,6 @@ RIGHT OUTER JOIN t3 AS als4 ON (als1.f3 = als4.f2) SET als1.f4 = 'eogqjvbhzodzimqahyzlktkbexkhdwxwgifikhcgblhgswxyutepc' 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 4219 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; CREATE TABLE t1( f1 VARCHAR(1)) ENGINE=myisam; @@ -1149,10 +634,6 @@ WHERE ( 'v', 'o' ) IN (SELECT DISTINCT t2.f1, t2.f2 FROM t4 RIGHT OUTER JOIN t2 ON (t4.f1 = t2.f1) WHERE t2.f3 BETWEEN '2001-10-04' AND '2003-05-15'); -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 noticed after reading const tables -Warnings: -Note 1003 update /*+ JOIN_ORDER(@`select#1` `t4`,`alias1`,`alias3`) */ `test`.`t1` semi join (`test`.`t2` left join `test`.`t4` on(`test`.`t4`.`f1` = `test`.`t2`.`f1` and `test`.`t2`.`f1` is not null)) left join (`test`.`t3` `alias1` join `test`.`t5` join `test`.`t3` `alias3`) on(`test`.`alias1`.`f3` = NULL and `test`.`t5`.`f1` = NULL and `test`.`alias3`.`f2` = `test`.`alias1`.`f2` and NULL is not null and `test`.`alias1`.`f2` is not null and NULL is not null) set `test`.`alias1`.`f1` = -1 where 0 DROP TABLE t1, t2, t3, t4, t5; CREATE TABLE t1 ( f1 INT(11) DEFAULT NULL, @@ -1180,11 +661,6 @@ t1 AS ta1 JOIN t1 AS ta2 ON ta1.f1 = ta2.f1 RIGHT JOIN t2 ON (ta1.f1 = t2.f1) SET ta1.f2 = '', ta2.f3 = '' WHERE ('n', 'r') IN (SELECT f2, f1 FROM t3 WHERE f1 <> f2 XOR ta2.f3 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 noticed after reading const tables -Warnings: -Note 1276 Field or reference 'test.ta2.f3' of SELECT #2 was resolved in SELECT #1 -Note 1003 update /*+ JOIN_SUFFIX(@`select#1` `ta1`,`t2`) */ `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta2`.`f1` = NULL and `test`.`ta1`.`f1` = NULL and NULL is not null and NULL is not null) set `test`.`ta1`.`f2` = '',`test`.`ta2`.`f3` = '' where 0 DROP TABLE t1, t2, t3; CREATE TABLE t2(f1 VARCHAR(255) DEFAULT NULL, f2 INT(11) DEFAULT NULL, KEY (f1), KEY (f2)) charset latin1 ENGINE=MyISAM; @@ -1224,11 +700,6 @@ ON alias5.f1 = alias8.f2 ON alias4.f2 = alias6.f1 JOIN t10 AS alias10 JOIN t11 AS alias11 ON alias10.f1 = alias11.f1 ON alias4.f2 = alias11.f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1105 Cannot use key `f2` part[0] for lookup: `test`.`t11`.`f2` of type `varchar` = "`alias4`.`f2`" of type `int` -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias11`,`alias8`) */ 1 AS `1` from `test`.`t4` `alias4` left join (`test`.`t5` `alias5` join `test`.`t6` `alias6` left join (`test`.`t7` `alias7` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias8`.`f1` = `test`.`alias7`.`f1` and `test`.`alias7`.`f1` is not null)) on(`test`.`alias5`.`f2` = NULL and `test`.`alias6`.`f1` = NULL and NULL is not null and `test`.`alias5`.`f2` is not null) join `test`.`t10` `alias10` join `test`.`t11` `alias11` where 0 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(alias11, alias10, alias8, alias7) */ 1 FROM t4 AS alias4 @@ -1237,11 +708,6 @@ ON alias5.f1 = alias8.f2 ON alias4.f2 = alias6.f1 JOIN t10 AS alias10 JOIN t11 AS alias11 ON alias10.f1 = alias11.f1 ON alias4.f2 = alias11.f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1105 Cannot use key `f2` part[0] for lookup: `test`.`t11`.`f2` of type `varchar` = "`alias4`.`f2`" of type `int` -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias11`,`alias10`,`alias8`,`alias7`) */ 1 AS `1` from `test`.`t4` `alias4` left join (`test`.`t5` `alias5` join `test`.`t6` `alias6` left join (`test`.`t7` `alias7` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias7`.`f1` = `test`.`alias8`.`f1` and `test`.`alias5`.`f1` is not null and `test`.`alias8`.`f1` is not null)) on(`test`.`alias5`.`f2` = NULL and `test`.`alias6`.`f1` = NULL and NULL is not null and `test`.`alias5`.`f2` is not null) join `test`.`t10` `alias10` join `test`.`t11` `alias11` where 0 DROP TABLES t2, t4, t5, t6, t7, t10, t11; CREATE TABLE t1 (f1 VARCHAR(255) DEFAULT NULL, f2 VARCHAR(255) DEFAULT NULL, KEY (f1), KEY (f2)) ENGINE=InnoDB; @@ -1285,17 +751,6 @@ ON alias6.f1 = alias5.f1 ON alias5.f3 = alias7.f1 ON alias1.f2 = alias7.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE alias1 index NULL f2 1023 NULL 1 100.00 Using index -1 SIMPLE alias7 ALL NULL NULL NULL NULL 1 0.00 Using where -1 SIMPLE alias2 ref f2 f2 5 test.alias7.f1 1 100.00 Using where -1 SIMPLE alias4 ref f1 f1 5 test.alias2.f1 1 100.00 Using where -1 SIMPLE alias3 eq_ref PRIMARY PRIMARY 4 test.alias4.f2 1 100.00 -1 SIMPLE alias5 ref f3 f3 43 test.alias7.f1 1 100.00 Using where; Using index -1 SIMPLE alias8 ref f2 f2 5 test.alias5.f1 1 100.00 Using where; Using index -1 SIMPLE alias6 eq_ref PRIMARY PRIMARY 4 test.alias8.f2 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias8`,`alias6`) */ 1 AS `1` from `test`.`t1` `alias1` left join (`test`.`t7` `alias7` join `test`.`t2` `alias2` left join (`test`.`t3` `alias3` join `test`.`t4` `alias4`) on(`test`.`alias3`.`f1` = `test`.`alias4`.`f2` and `test`.`alias4`.`f1` = `test`.`alias2`.`f1` and `test`.`alias2`.`f1` is not null and `test`.`alias4`.`f2` is not null) join `test`.`t10` `alias5` left join (`test`.`t6` `alias6` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias6`.`f1` = `test`.`alias5`.`f1` and `test`.`alias5`.`f1` is not null and `test`.`alias8`.`f2` is not null)) on(`test`.`alias7`.`f1` = `test`.`alias1`.`f2` and `test`.`alias5`.`f3` = `test`.`alias1`.`f2` and `test`.`alias2`.`f2` = `test`.`alias7`.`f1` and `test`.`alias1`.`f2` is not null and `test`.`alias7`.`f1` is not null and `test`.`alias7`.`f1` is not null) where 1 DROP TABLES t1, t2, t3, t4, t6, t7, t10; # # Bug#23144230 WL#9158 : OPT_HINTS_QB::APPLY_JOIN_ORDER_HINTS - MYSQLD GOT SIGNAL 11 @@ -1324,12 +779,6 @@ FROM ( SELECT * FROM t1 ) AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias1.f2 = alias2.f3 WHERE alias2.f2 IS NULL HAVING (field1 != 3 AND field1 >= 8); -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 4221 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; # # Bug#23651098 WL#9158 : ASSERTION `!(SJ_NEST->SJ_INNER_TABLES & JOIN->CONST_TABLE_MAP)' FAILED @@ -1357,10 +806,6 @@ test.t3 analyze status Table is already up to date EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2, t1) */ t1.f1 FROM t1, t2 WHERE t2.f1 IN (SELECT t3.f1 FROM t3) AND t1.f1 = 183; -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 noticed after reading const tables -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) */ NULL AS `f1` from `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` where 0 DROP TABLE t1, t2, t3; # # Bug23715779 SELECT QUERY WITH JOIN_PREFIX() HINT RETURNS INCORRECT RESULT @@ -1395,14 +840,6 @@ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND ta3.f2 IN (SELECT /*+ QB_NAME(qb2) */ f2 FROM t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 -1 PRIMARY t2 index f2 f2 5 NULL 3 100.00 Using where; Using index; LooseScan -1 PRIMARY ta3 ref f2 f2 5 test.t2.f2 1 33.33 Using index -1 PRIMARY ta4 index PRIMARY f2 5 NULL 3 100.00 Using index; Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 5 test.ta4.f1 1 100.00 Using where; FirstMatch(ta4); Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select count(0) AS `COUNT(*)` from `test`.`t1` semi join (`test`.`t4`) semi join (`test`.`t2`) join `test`.`t2` `ta3` join `test`.`t2` `ta4` where `test`.`t4`.`f1` = `test`.`ta4`.`f1` and `test`.`ta3`.`f2` = `test`.`t2`.`f2` SELECT /*+ JOIN_PREFIX(t2@qb2, t4@qb1, ta3, ta4) */ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND @@ -1413,14 +850,6 @@ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND ta3.f2 IN (SELECT /*+ QB_NAME(qb2) */ f2 FROM t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index f2 f2 5 NULL 3 100.00 Using where; Using index; Start temporary -1 PRIMARY t4 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY ta3 ref f2 f2 5 test.t2.f2 1 100.00 Using index -1 PRIMARY ta4 eq_ref PRIMARY PRIMARY 4 test.t4.f1 1 33.33 End temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`@`qb2`,`t4`@`qb1`,`ta3`,`ta4`) */ count(0) AS `COUNT(*)` from `test`.`t1` semi join (`test`.`t4`) semi join (`test`.`t2`) join `test`.`t2` `ta3` join `test`.`t2` `ta4` where `test`.`ta4`.`f1` = `test`.`t4`.`f1` and `test`.`ta3`.`f2` = `test`.`t2`.`f2` DROP TABLE t1, t2, t4; MDEV-36638 Some optimizer hint warnings are returned as errors @@ -1446,22 +875,10 @@ INSERT INTO tn (fn_1, fn_2) SELECT /*+ JOIN_ORDER(t2,t1) JOIN_FIXED_ORDER() */ f1,f2 FROM t2 JOIN t1 ON t1.id=t2.id ORDER BY f1, f2; -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 Using temporary; Using filesort -1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 33.33 Using where; Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated -Note 1003 insert into `test`.`tn`(fn_1,fn_2) select /*+ JOIN_ORDER(@`select#1` `t2`,`t1`) */ `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`id` = `test`.`t2`.`id` order by `test`.`t1`.`f1`,`test`.`t2`.`f2` EXPLAIN EXTENDED INSERT INTO tn (fn_1, fn_2) SELECT /*+ JOIN_ORDER(t1,t2) */ f1,f2 FROM t2 LEFT JOIN t1 ON t1.id=t2.id ORDER BY f1, f2; -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 Using temporary; Using filesort -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 100.00 Using where -Warnings: -Warning 4219 Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated -Note 1003 insert into `test`.`tn`(fn_1,fn_2) select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`id` is not null) where 1 order by `test`.`t1`.`f1`,`test`.`t2`.`f2` DROP TABLE tn; DROP TABLE t1, t2; CREATE TABLE t1 (a int, b varchar(50), c varchar(50)); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_hints_join_order/' main.large_pages [ pass ] 20 main.flush_block_commit_notembedded [ pass ] 1209 main.drop_table_force [ pass ] 76 main.alter_table_online_debug 'binlog' [ pass ] 2613 main.innodb_mysql_lock2 [ pass ] 1051 main.alter_table_online 'binlog' [ pass ] 294 main.bug39022 [ pass ] 40 main.commit_1innodb [ pass ] 867 main.create_select [ pass ] 33 main.sp_trans [ pass ] 514 main.xa_binlog [ pass ] 38 main.partition_exchange [ pass ] 294 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.stat_tables_innodb [ fail ] Test ended at 2026-04-22 14:06:15 CURRENT_TEST: main.stat_tables_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.result 2026-04-02 14:38:09.473657332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.reject 2026-04-22 14:06:15.205654979 +0300 @@ -76,13 +76,6 @@ and o_orderdate < date '1995-01-01' + interval '1' year group by n_name order by revenue desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where -1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index -1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey @@ -207,13 +200,6 @@ and o_orderdate < date '1995-01-01' + interval '1' year group by n_name order by revenue desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where -1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index -1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey @@ -243,15 +229,6 @@ and p_type = 'STANDARD BRUSHED STEEL' ) as all_nations group by o_year order by o_year; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort -1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join) -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 5 dbt3_s001.part.p_partkey 30 Using index condition -1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.lineitem.l_suppkey 1 Using where -1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 -1 SIMPLE orders eq_ref PRIMARY,i_o_orderdate,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where -1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where -1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey i_n_regionkey 9 dbt3_s001.region.r_regionkey,dbt3_s001.customer.c_nationkey 1 Using index select o_year, sum(case when nation = 'UNITED STATES' then volume else 0 end) / sum(volume) as mkt_share @@ -282,13 +259,6 @@ and p_name like '%green%') as profit group by nation, o_year order by nation, o_year desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 -1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 -1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 Using where -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 -1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 EXPLAIN EXTENDED select nation, o_year, sum(amount) as sum_profit from (select n_name as nation, extract(year from o_orderdate) as o_year, @@ -300,15 +270,6 @@ and p_name like '%green%') as profit group by nation, o_year order by nation, o_year desc; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 100.00 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 -1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 100.00 -1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 100.00 Using where -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 100.00 -1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 100.00 -Warnings: -Note 1003 select `dbt3_s001`.`nation`.`n_name` AS `nation`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) AS `o_year`,sum(`dbt3_s001`.`lineitem`.`l_extendedprice` * (1 - `dbt3_s001`.`lineitem`.`l_discount`) - `dbt3_s001`.`partsupp`.`ps_supplycost` * `dbt3_s001`.`lineitem`.`l_quantity`) AS `sum_profit` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`lineitem` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`orders` join `dbt3_s001`.`nation` where `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`orders`.`o_orderkey` = `dbt3_s001`.`lineitem`.`l_orderkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`part`.`p_name` like '%green%' group by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc order by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc select nation, o_year, sum(amount) as sum_profit from (select n_name as nation, extract(year from o_orderdate) as o_year, @@ -386,10 +347,6 @@ from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' and o_orderkey=l_orderkey and p_partkey=l_partkey; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE part range PRIMARY,i_p_retailprice i_p_retailprice 9 NULL 1 Using where; Using index -1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const 1 Using index -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity i_l_partkey 9 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey 1 Using index select o_orderkey, p_partkey from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' @@ -431,13 +388,9 @@ FLUSH TABLE t1; SET use_stat_tables='never'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 FLUSH TABLES; SET use_stat_tables='preferably'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # @@ -462,9 +415,6 @@ 1 AUS EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where ANALYZE TABLE t2; Table Op Msg_type Msg_text test.t2 analyze status Engine-independent statistics collected @@ -474,9 +424,6 @@ 1 AUS EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where DROP TABLE t1,t2; # # MDEV-7370: Server deadlocks on renaming a table for which persistent statistics exists @@ -642,9 +589,6 @@ set @@use_stat_tables= PREFERABLY; explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 -1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL Using join buffer (flat, BNL join) set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; # @@ -973,31 +917,15 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connect con1, localhost, root,,; connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; update t1 set a= a +100; # Explain shows outdated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; analyze table t1 persistent for all; Table Op Msg_type Msg_text @@ -1005,16 +933,8 @@ test.t1 analyze status OK # Now explain shows updated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; # Run update and analyze in con1: update t1 set a= a - 150; @@ -1025,10 +945,6 @@ connection default; # Explain shows updated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 disconnect con1; drop table t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.stat_tables_innodb/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.selectivity_innodb [ fail ] Test ended at 2026-04-22 14:06:25 CURRENT_TEST: main.selectivity_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.result 2026-04-02 14:38:09.454657383 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.reject 2026-04-22 14:06:25.020635463 +0300 @@ -33,16 +33,8 @@ flush table t1; explain extended select * from t1 where a is null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null explain extended select * from t1 where a is not null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null drop table t1; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP DATABASE IF EXISTS dbt3_s001; @@ -77,19 +69,6 @@ ) order by s_acctbal desc, n_name, s_name, p_partkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.63 Using where; Using join buffer (flat, BNL join) -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 -2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and (`dbt3_s001`.`part`.`p_size` = 9 or `dbt3_s001`.`part`.`p_size` = 19999) and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` set optimizer_use_condition_selectivity=4; explain extended select @@ -118,19 +97,6 @@ ) order by s_acctbal desc, n_name, s_name, p_partkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 2.08 Using where; Using join buffer (flat, BNL join) -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 -2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` === Q15 === create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) @@ -147,14 +113,6 @@ where s_suppkey = supplier_no and total_revenue = (select max(total_revenue) from revenue0) order by s_suppkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 -1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 1 100.00 Using where -3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -2 SUBQUERY ALL NULL NULL NULL NULL 10 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -168,14 +126,6 @@ where s_suppkey = supplier_no and total_revenue = (select max(total_revenue) from revenue0) order by s_suppkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 -1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 1 100.00 Using where -3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -2 SUBQUERY ALL NULL NULL NULL NULL 10 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -197,12 +147,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 100.00 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -241,12 +185,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 16.67 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -285,12 +223,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 16.67 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -330,14 +262,6 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort -1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index -2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -364,14 +288,6 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort -1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index -2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -403,13 +319,6 @@ ) as vip group by cntrycode order by cntrycode; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY customer ALL NULL NULL NULL NULL 150 100.00 Using where; Using temporary; Using filesort -4 DEPENDENT SUBQUERY orders ref i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 100.00 Using index -3 SUBQUERY customer ALL NULL NULL NULL NULL 150 100.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,<`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -444,13 +353,6 @@ ) as vip group by cntrycode order by cntrycode; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY customer ALL NULL NULL NULL NULL 150 100.00 Using where; Using temporary; Using filesort -4 DEPENDENT SUBQUERY orders ref i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 100.00 Using index -3 SUBQUERY customer ALL NULL NULL NULL NULL 150 91.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,<`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -490,17 +392,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier ALL PRIMARY,i_s_nationkey NULL NULL NULL 10 100.00 Using where; Using filesort -1 PRIMARY nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 100.00 Using where -2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -544,16 +435,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 11.99 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -599,16 +480,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.03 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 7.11 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -654,16 +525,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -709,16 +570,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -759,11 +610,6 @@ (1,9), (6,3), (2,8), (4,1), (0,7), (4,8), (4,5); EXPLAIN EXTENDED SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -1 SIMPLE t2 ref idx idx 5 test.t1.b 1 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t1`.`b` SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); a b c d 0 7 0 7 @@ -781,19 +627,11 @@ set optimizer_use_condition_selectivity=1; explain extended select * from t1 where a < 1 and a > 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a set optimizer_use_condition_selectivity=3; explain extended select * from t1 where a < 1 and a > 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a drop table t1; @@ -803,11 +641,6 @@ insert into t2 values (2),(3); explain extended select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 3 select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); a drop table t1,t2; @@ -840,10 +673,6 @@ flush table t1; set optimizer_use_condition_selectivity=4; explain extended select * from t1 where a=0; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; set histogram_size=@save_histogram_size; set histogram_type=@save_histogram_type; @@ -875,19 +704,11 @@ set optimizer_use_condition_selectivity=1; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 DROP TABLE t1,t2; @@ -909,10 +730,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 75.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 SELECT * FROM t1 WHERE a > 3; a 9 @@ -941,11 +758,6 @@ set optimizer_switch='index_condition_pushdown=off'; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a > 9; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` > 9 SELECT * FROM t1, t2 WHERE a > 9; a b c set optimizer_switch=@save_optimizer_switch; @@ -990,13 +802,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 7 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 14 100.00 Using where; Using join buffer (flat, BNL join) -2 SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((1,exists(/* select#2 */ select 1 from `test`.`t1` join `test`.`t2` limit 1))) and `test`.`t1`.`a` <> `test`.`t2`.`b` or `test`.`t1`.`a` <= 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; @@ -1016,28 +821,12 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 28.57 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NOT NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 71.43 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a IS NOT NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a < 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 69.39 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` < 5 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; @@ -1143,10 +932,6 @@ count(*) 3 explain extended select * from t1 where a between 5 and 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 alter table t1 change column a a int; analyze table t1; Table Op Msg_type Msg_text @@ -1154,10 +939,6 @@ test.t1 analyze status OK flush table t1; explain extended select * from t1 where a between 5 and 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1; set use_stat_tables=@save_use_stat_tables; @@ -1187,10 +968,6 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 ); -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 noticed after reading const tables -Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`c3` = 'b')) where 0 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; # @@ -1252,12 +1029,6 @@ EXPLAIN EXTENDED SELECT * FROM language, country, continent WHERE country_group = lang_group AND lang_group IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE language ALL NULL NULL NULL NULL 6 16.67 Using where -1 SIMPLE country ALL NULL NULL NULL NULL 2 50.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE continent ALL NULL NULL NULL NULL 6 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where `test`.`country`.`country_group` = `test`.`language`.`lang_group` and `test`.`language`.`lang_group` is null set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table language, country, continent; set use_stat_tables=@save_use_stat_tables; @@ -1300,12 +1071,6 @@ explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 100.00 Using where -1 SIMPLE t2 ref c,d c 5 test.t1.b 5 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`a` = `test`.`t2`.`d` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1317,12 +1082,6 @@ explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 0.00 Using where -1 SIMPLE t2 ref c,d d 5 test.t3.a 7 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 2.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t1`.`b` = `test`.`t2`.`c` and `test`.`t2`.`d` = `test`.`t3`.`a` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1346,11 +1105,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE c >= 0 OR a = b ; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 select 'foo' AS `a`,'foo' AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 1 SELECT * FROM t1, t2 WHERE c >= 0 OR a = b ; a b c foo foo 1 @@ -1379,18 +1133,8 @@ test.t2 analyze status OK explain extended select * from t1 straight_join t2 where t1.a=t2.a and t1.a<10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 explain extended select * from t1 straight_join t2 where t1.a=t2.a and t2.a<10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1412,11 +1156,6 @@ test.t2 analyze status OK explain extended select * from t2 a straight_join t2 b where a.a is null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 1000 100.00 Using where -1 SIMPLE b ALL NULL NULL NULL NULL 1000 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where `test`.`a`.`a` is null set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1440,11 +1179,6 @@ EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref PRIMARY,b b 5 const 1 100.00 Using where; Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <> 'USARussian' and `test`.`t1`.`b` is null SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; a b i @@ -1464,10 +1198,6 @@ test.t1 analyze status OK explain extended select * from t1 where col1 > 'b' and col1 < 'e'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` > 'b' and `test`.`t1`.`col1` < 'e' select * from t1 where col1 > 'b' and col1 < 'e'; col1 c @@ -1499,27 +1229,15 @@ c explain extended select * from t1 where col1 > 'b' and col1 < 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 28.57 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` > 'b' and `test`.`t1`.`col1` < 'd' select * from t2 where col1 > 'b' and col1 < 'd'; col1 c explain extended select * from t2 where col1 > 'b' and col1 < 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` > 'b' and `test`.`t2`.`col1` < 'd' select * from t2 where col1 < 'b' and col1 > 'd'; col1 explain extended select * from t2 where col1 < 'b' and col1 > 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` < 'b' and `test`.`t2`.`col1` > 'd' drop table t1,t2; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; @@ -1552,12 +1270,6 @@ (11,11),(12,12),(13,13),(14,14),(15,15); set @@optimizer_use_condition_selectivity=2; explain extended select * from t1 where a in (select max(a) from t1 group by b); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where ``.`max(a)` = `test`.`t1`.`a` select * from t1 where a in (select max(a) from t1 group by b); a b 0 0 @@ -1578,12 +1290,6 @@ 15 15 set @@optimizer_use_condition_selectivity=1; explain extended select * from t1 where a in (select max(a) from t1 group by b); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where ``.`max(a)` = `test`.`t1`.`a` select * from t1 where a in (select max(a) from t1 group by b); a b 0 0 @@ -1662,22 +1368,10 @@ 62 # Check what info the optimizer has about selectivities explain extended select * from t1 use index () where a in (17,51,5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 6.20 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5) explain extended select * from t1 use index () where b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 4.20 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2 # Now, the equality is used for ref access, while the range condition # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref|filter b,a b|a 5|5 const 42 (6%) 6.30 Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) truncate table t1; insert into t1 select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000; @@ -1692,10 +1386,6 @@ count(*) 29 explain extended select * from t1 where a in (17,51,5) and b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; set use_stat_tables= @save_use_stat_tables; set @@histogram_size=@save_histogram_size; @@ -1738,8 +1428,6 @@ set @@optimizer_use_condition_selectivity=2; EXPLAIN SELECT * FROM City WHERE Country='FIN'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 7 Using index condition DROP DATABASE world; use test; CREATE TABLE t1 ( @@ -1770,8 +1458,6 @@ INSERT INTO t1 SELECT a + 1280, b, c FROM t1 LIMIT 80; EXPLAIN SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b,b_2 b 4 NULL 226 Using where SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9; a 2071 @@ -1799,12 +1485,6 @@ set optimizer_use_condition_selectivity=1; explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; b a a b @@ -1821,12 +1501,6 @@ set optimizer_use_condition_selectivity=2; explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; b a a b @@ -1846,12 +1520,6 @@ test.t1 analyze status OK explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 set optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; drop table t1,t2,t3; # @@ -1929,10 +1597,6 @@ WHERE EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id WHERE A.a=t1.a AND t2.b < 20); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index -2 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where set optimizer_switch= @save_optimizer_switch; drop table t1,t2; # @@ -1963,10 +1627,6 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.67 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 SELECT HEX(a), b from t1 where t1.a >= 81; HEX(a) b 51 81 @@ -1987,23 +1647,11 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 SET optimizer_use_condition_selectivity=3; # filtered should show 25 % EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; @@ -2020,9 +1668,6 @@ insert into t2 select seq,seq,seq from seq_1_to_100; set optimizer_use_condition_selectivity=2; EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE A const PRIMARY,a PRIMARY 4 const 1 -1 SIMPLE B ref a a 5 const 1 Using index set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; # @@ -2051,9 +1696,6 @@ create index t1_c2 on t1 (c2,c1); explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1 drop table t1; create table t1 (old_c1 integer, old_c2 integer, c1 integer, c2 integer, c3 integer) engine=aria; @@ -2074,9 +1716,6 @@ truncate table t1; insert into t1 select * from t2; explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1 drop trigger trg_t1; drop table t1,t2; create table t1 (old_c1 integer, old_c2 integer, c1 integer, @@ -2088,9 +1727,6 @@ truncate table t1; insert into t1 select * from t2; explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 2 drop table t1,t2; # # MDEV-31864 Assertion `d >= 0' failed in COST_ADD with join_cache_level @@ -2111,10 +1747,6 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1; a b c d e 1 NULL NULL NULL NULL @@ -2135,17 +1767,9 @@ # Must produce filtered=1% or so: explain extended select * from t1 where a like '%99%'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' # Must have same filtered as above explain extended select * from t1 where a like '%99%' and (b is null or b is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' and (`test`.`t1`.`b` is null or `test`.`t1`.`b` is not null) drop table t1; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set use_stat_tables= @save_use_stat_tables; @@ -2253,10 +1877,6 @@ bar EXPLAIN EXTENDED SELECT * FROM t1 WHERE f1 < 'm'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 72.09 Using where -Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where `test`.`t1`.`f1` < 'm' CREATE TABLE t2 (f1 TEXT) ENGINE=InnoDB; INSERT INTO t2 VALUES ('foo'),('bar'),('qux'); ANALYZE TABLE t2; @@ -2270,10 +1890,6 @@ bar EXPLAIN EXTENDED SELECT * FROM t2 WHERE f1 <> 'qux'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`f1` AS `f1` from `test`.`t2` where `test`.`t2`.`f1` <> 'qux' DROP TABLE t1,t2; # # End of 10.0 tests @@ -2341,9 +1957,6 @@ TEXT46 TEXT,TEXT47 TEXT,TEXT48 TEXT,TEXT49 TEXT,TEXT50 TEXT ) ENGINE=InnoDB; EXPLAIN SELECT 1 FROM t1 NATURAL JOIN t1 AS t2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where -1 SIMPLE t2 hash_ALL NULL #hash#$hj 150 test.t1.TEXT1,test.t1.TEXT2,test.t1.TEXT3,test.t1.TEXT4,test.t1.TEXT5,test.t1.TEXT6,test.t1.TEXT7,test.t1.TEXT8,test.t1.TEXT9,test.t1.TEXT10,test.t1.TEXT11,test.t1.TEXT12,test.t1.TEXT13,test.t1.TEXT14,test.t1.TEXT15,test.t1.TEXT16,test.t1.TEXT17,test.t1.TEXT18,test.t1.TEXT19,test.t1.TEXT20,test.t1.TEXT21,test.t1.TEXT22,test.t1.TEXT23,test.t1.TEXT24,test.t1.TEXT25,test.t1.TEXT26,test.t1.TEXT27,test.t1.TEXT28,test.t1.TEXT29,test.t1.TEXT30,test.t1.TEXT31,test.t1.TEXT32,test.t1.TEXT33,test.t1.TEXT34,test.t1.TEXT35,test.t1.TEXT36,test.t1.TEXT37,test.t1.TEXT38,test.t1.TEXT39,test.t1.TEXT40,test.t1.TEXT41,test.t1.TEXT42,test.t1.TEXT43,test.t1.TEXT44,test.t1.TEXT45,test.t1.TEXT46,test.t1.TEXT47,test.t1.TEXT48,test.t1.TEXT49,test.t1.TEXT50 1 Using where; Using join buffer (flat, BNLH join) set join_cache_level=@tmp_jcl; drop table t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb/' main.alter_table_online_debug 'nobinlog' [ pass ] 2212 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.partition_explicit_prune [ fail ] Test ended at 2026-04-22 14:06:30 CURRENT_TEST: main.partition_explicit_prune --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.result 2026-04-17 18:40:40.465800292 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.reject 2026-04-22 14:06:29.540861540 +0300 @@ -452,30 +452,20 @@ EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (pNonexistent); ERROR HY000: Unknown partition 'pNonexistent' in table 't1' EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp2); -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0-9_subp2 index NULL b 71 NULL 2 Using index FLUSH STATUS; EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp2,pNeg) AS TableAlias; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE TableAlias pNeg_subp0,pNeg_subp1,p0-9_subp2 index NULL b 71 NULL 4 Using index SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_TMP_WRITE 24 +HANDLER_READ_KEY 6 +HANDLER_READ_RND_NEXT 2 +HANDLER_TMP_WRITE 25 # 8 locks (1 ha_partition + 3 ha_innobase) x 2 (lock/unlock) EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp3) AS TableAlias; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE TableAlias p0-9_subp3 index NULL b 71 NULL 3 Using index EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 PARTITION (`p10-99`); -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL b 71 NULL 2 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1000000; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (pNeg) WHERE a = 100; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Test how it changes the alias/keywords/reserved words SELECT * FROM t1 PARTITION; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 @@ -578,7 +568,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -596,7 +586,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_ROLLBACK 1 @@ -612,7 +602,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_ROLLBACK 1 @@ -627,7 +617,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 4 HANDLER_DELETE 2 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 8 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 112 HANDLER_ROLLBACK 1 @@ -650,7 +640,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 140 HANDLER_ROLLBACK 1 @@ -670,7 +660,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 168 HANDLER_ROLLBACK 1 @@ -697,6 +687,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 4 +HANDLER_READ_KEY 6 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 # 1 commit @@ -774,7 +765,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 12 HANDLER_READ_RND_NEXT 2 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -793,7 +784,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 # 1 commit @@ -807,7 +798,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -822,6 +813,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -831,6 +823,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -875,7 +868,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 1 @@ -905,6 +898,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -913,6 +907,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -928,7 +923,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -942,7 +937,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -958,7 +953,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -988,7 +983,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 # 1 delete # 4 locks (pruning works!). @@ -1000,6 +995,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 +HANDLER_READ_KEY 6 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 1 delete @@ -1020,7 +1016,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 # + 3 read key (1 innodb_get_index in records_in_range @@ -1031,7 +1027,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -1044,7 +1040,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -1059,7 +1055,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1095,6 +1091,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 +HANDLER_READ_KEY 12 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 7 @@ -1107,7 +1104,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1216,6 +1213,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 15 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 12 locks (3 in t1, 1 in t3, 2 in t2) x 2 (lock + unlock) @@ -1233,7 +1231,7 @@ HANDLER_COMMIT 1 HANDLER_DELETE 6 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 17 HANDLER_READ_NEXT 2 HANDLER_READ_RND 4 HANDLER_READ_RND_NEXT 22 @@ -1613,17 +1611,9 @@ create table t1 (a int) partition by hash(a) partitions 3; insert into t1 values(1),(2),(3); explain partitions select * from t1 where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p1) where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p1) where a=1 or a=2; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p2) where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; # # Bug#59864: Crash if table empty: DELETE FROM t2 PARTITION (subp3). @@ -1935,8 +1925,6 @@ from seq_1_to_5000; explain select * from t1 partition (p1) where a=10 and b=10; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where flush tables; select * from t1 partition (p1)where a=10 and b=10; pk a b filler Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_explicit_prune/' main.partition_icp [ pass ] 714 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.partition_innodb2 [ fail ] Test ended at 2026-04-22 14:06:31 CURRENT_TEST: main.partition_innodb2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_innodb2.result 2026-04-02 14:38:09.429657451 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_innodb2.reject 2026-04-22 14:06:31.230623089 +0300 @@ -17,8 +17,5 @@ mod(seq, 10), seq from seq_1_to_50; explain delete t1, t2 from t1, t2 where t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t2 ref a a 5 test.t1.a # delete t1, t2 from t1, t2 where t1.a=t2.a; drop table t1,t2; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_innodb2/' main.repair [ pass ] 1649 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.multi_update [ fail ] Test ended at 2026-04-22 14:06:37 CURRENT_TEST: main.multi_update --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.result 2026-04-17 18:40:40.439798686 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.reject 2026-04-22 14:06:36.653612268 +0300 @@ -1066,9 +1066,6 @@ create table t2 (f int) engine=myisam; insert t2 values (1),(2); explain update t1, t2 set f = 126 order by f limit 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 update t1, t2 set f = 126 order by f limit 2; select * from t2; f @@ -1090,10 +1087,6 @@ 4 4 4 4 4 4 set optimizer_switch='firstmatch=off'; explain update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c< t2.c) order by t2.c, t1.c limit 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using where; Using temporary; Using filesort -1 PRIMARY t1 ref a a 5 test.t2.a 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c<=t2.c) order by t2.c, t1.c limit 5; select * from t2; a b c @@ -1122,10 +1115,6 @@ 0 1 0 0 2 0 explain update v1,t0 set c=1 where b=1 and x=c order by x,b limit 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t0 ALL NULL NULL NULL NULL 2 Using where update v1,t0 set c=1 where b<3 and x=c order by x,b limit 1; select * from v1; b c @@ -1179,94 +1168,10 @@ INSERT INTO t2 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2); # Expecting partition "Current" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=0 AND t1.part=0; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Current"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Current"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} # Expecting partition "Relevant" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=2 WHERE t2.part=1 AND t1.part=1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Relevant"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Relevant"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} # Expecting partition "Archive" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=2 AND t1.part=2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Archive"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Archive"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} DROP TABLES t1, t2; # End of 10.3 tests # @@ -1301,26 +1206,14 @@ where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using index condition; Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 explain delete from t1 using t1,t3 where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index explain update t1,t3 set t1.c1 = t1.c1+10 where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index create table t as select * from t1; select * from t1,t3 where t1.c2 = t3.c2 and @@ -1428,10 +1321,6 @@ 3 EXPLAIN UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt); SELECT * FROM t1; @@ -1493,10 +1382,6 @@ 3 EXPLAIN UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); SELECT * FROM t1; @@ -1558,9 +1443,6 @@ 3 EXPLAIN UPDATE t1 SET a = NULL WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) UPDATE t1 SET a = NULL WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt); SELECT * FROM t1; @@ -1622,9 +1504,6 @@ 3 EXPLAIN UPDATE t1 SET a = NULL WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) UPDATE t1 SET a = NULL WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); SELECT * FROM t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.multi_update/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ^CStopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$