psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ time ./mysql-test-run --verbose --max-test-fail=5000 --suite=main --big --replay-server --force Logging: ./mysql-test-run --verbose --max-test-fail=5000 --suite=main --big --replay-server --force VS config: > ASAN_OPTIONS=suppressions=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/asan.supp:abort_on_error=1: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... > opt_vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var - WARNING: Using the 'mysql-test/var' symlink > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1 > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/install.db > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/my.cnf > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/plugins > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/run > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/std_data > Removing subdir /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp > Removing /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/ Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... > cmd: /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd --no-defaults --datadir=. --basedir=/home/psergey/dev-git/11.8-skip-records-in-range --lc-messages-dir=/home/psergey/dev-git/11.8-skip-records-in-range/sql/share --skip-grant-tables --log-warnings=0 --log-slow-admin-statements=0 --log-queries-not-using-indexes=0 --log-slow-slave-statements=0 --verbose --help MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled Using suites: main Collecting tests... Installing system database... > Spent 1.059 seconds in bootstrap 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 186682 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] - 'localhost:19011' was not free worker[01] - 'localhost:19041' was not free worker[01] Using MTR_BUILD_THREAD 302, with reserved ports 19060..19089 worker[01] Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... worker[01] > result: , file_mode: 0 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 worker[01] > Running test: main.connect-abstract worker[01] > Setting timezone: DEFAULT worker[01] > Cleaning datadirs... worker[01] > clean_dir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp worker[01] > unlink: '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/replay_server.current_pid' worker[01] > unlink: '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info' worker[01] > Generating my.cnf from '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/connect-abstract.cnf' worker[01] > MASTER_MYPORT = 19060 worker[01] > MASTER_MYSOCK = /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/mysqld.1.sock worker[01] > OPENSSL_ENABLE_SHA1_SIGNATURES = 1 worker[01] > ABSTRACT_SOCKET = @mtr-test-abstract-socket-19061 worker[01] > 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/mysqld.1/data worker[01] > mysqld_start: [' '] worker[01] > Started [mysqld.1 - pid: 186703, winpid: 186703] worker[01] Started [check-mysqld_1 - pid: 186709, winpid: 186709] worker[01] Got [check-mysqld_1 - pid: 186709, winpid: 186709, exit: 0] worker[01] > Started [mysqltest - pid: 186712, winpid: 186712] worker[01] > Started [warnings-mysqld.1 - pid: 186714, winpid: 186714] worker[01] Got [warnings-mysqld.1 - pid: 186714, winpid: 186714, exit: 15872] worker[01] Started [check-mysqld_1 - pid: 186716, winpid: 186716] worker[01] Got [check-mysqld_1 - pid: 186716, winpid: 186716, exit: 0] worker[01] main.connect-abstract worker[01] [ pass ] 1 main.connect-abstract [ pass ] 1 worker[01] > Running test: main.connect worker[01] > Setting timezone: DEFAULT worker[01] Stopping [mysqld.1 - pid: 186703, winpid: 186703] worker[01] > Cleaning datadirs... worker[01] > - removing '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/mysqld.1' worker[01] > clean_dir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp worker[01] > unlink: '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/check-mysqld_1.log' worker[01] > rmdir: '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/mysqld.1' worker[01] > Removing ABSTRACT_SOCKET worker[01] > Removing OPENSSL_ENABLE_SHA1_SIGNATURES worker[01] > Removing MASTER_MYPORT worker[01] > Removing MASTER_MYSOCK worker[01] > Generating my.cnf from '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/connect.cnf' worker[01] > MASTER_MYPORT = 19060 worker[01] > MASTER_MYSOCK = /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/mysqld.1.sock worker[01] > OPENSSL_ENABLE_SHA1_SIGNATURES = 1 worker[01] > MASTER_EXTRA_PORT = 19061 worker[01] > 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/mysqld.1/data worker[01] > mysqld_start: [' '] worker[01] > Started [mysqld.1 - pid: 186721, winpid: 186721] worker[01] Started [check-mysqld_1 - pid: 186727, winpid: 186727] worker[01] Got [check-mysqld_1 - pid: 186727, winpid: 186727, exit: 0] worker[01] > Started [mysqltest - pid: 186730, winpid: 186730] ^CStopping replay server... Replay server stopped real 0m16.193s user 0m1.844s sys 0m3.454s psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ time ./mysql-test-run --max-test-fail=5000 --suite=main --big --replay-server --force Logging: ./mysql-test-run --max-test-fail=5000 --suite=main --big --replay-server --force VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... - WARNING: Using the 'mysql-test/var' symlink 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 186775 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] - 'localhost:19011' was not free worker[01] - 'localhost:19041' was not free worker[01] Using MTR_BUILD_THREAD 302, with reserved ports 19060..19089 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 ] 1 main.connect [ pass ] 14491 main.connect2 [ pass ] 44 main.join_cache_notasan [ pass ] 47 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "./include/common-tests.inc": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.test at line 17: ReplayTest: At line 1477 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:48:17 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-23 22:48:17.769842509 +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 @@ -2013,7 +2010,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 ] 127 main.ssl_encrypted_key 'file' [ pass ] 233 main.ssl_encrypted_key 'pass' [ pass ] 141 main.optimizer_costs2 [ pass ] 8 main.ipv4_and_ipv6 [ pass ] 648 main.ipv4_as_ipv6 [ pass ] 1877 main.ipv6 [ pass ] 954 main.bind_multiple_addresses_resolution [ pass ] 42 main.bind_address_resolution [ pass ] 31 main.sp_trans_log [ pass ] 138 main.tc_heuristic_recover [ pass ] 3102 main.merge_alter [ pass ] 53 main.mysqlbinlog_row_minimal [ pass ] 245 main.long_unique_bugs [ pass ] 552 main.tmp_space_usage [ pass ] 26404 main.stat_tables_rbr [ pass ] 138 main.ctype_cp932_binlog_row [ pass ] 147 main.mysqlbinlog_row_compressed [ pass ] 173 main.invisible_partition [ pass ] 46 main.mysqlbinlog-innodb [ pass ] 49 main.partition_innodb_stmt [ pass ] 52 main.session_tracker_sysvar [ pass ] 30 main.tmp_table_binlog [ pass ] 31 main.mysqlbinlog [ pass ] 1865 main.mysqlbinlog_stmt_compressed [ pass ] 161 main.set_statement_notembedded_binlog [ pass ] 37 main.partition_binlog_stmt [ pass ] 42 main.backup_lock_binlog [ pass ] 2026 main.lock_tables_lost_commit [ pass ] 40 main.ctype_collate_implicit_def [ pass ] 57 main.ctype_filesystem [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ps [ fail ] Test ended at 2026-04-23 22:49:37 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-23 22:49:37.066692586 +0300 @@ -5505,8 +5505,6 @@ 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 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 ] 3215 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:49:43 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-23 22:49:42.835279949 +0300 @@ -112,7 +112,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -136,7 +138,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -160,7 +164,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -184,7 +190,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -208,7 +216,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(259); select * from t1 where v like 'This is a test' order by v; v @@ -232,7 +242,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -256,7 +268,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -280,7 +294,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -304,7 +320,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -328,7 +346,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. alter table t1 change v v varchar(254); select * from t1 where v like 'This is a test' order by v; v @@ -352,7 +372,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 381. 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 +400,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 368. drop table t1; create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol)) charset=latin1; insert into t1 values ('test', 'something'); 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 ] 150 main.ctype_ucs2_query_cache [ pass ] 59 main.ctype_ucs2_def [ pass ] 50 main.ctype_utf16_def [ pass ] 45 main.ctype_utf32_def [ pass ] 45 main.lowercase_utf8 [ pass ] 12 main.bug47671 [ pass ] 74 main.ctype_utf8_def_upgrade [ pass ] 47 main.mysql_upgrade-34014 [ pass ] 1775 main.ctype_utf8mb4_unicode_ci_def [ pass ] 36 main.ctype_ldml [ pass ] 425 main.grant [ pass ] 796 main.grant2 [ pass ] 348 main.grant4 [ pass ] 136 main.mysqldump [ pass ] 59655 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-23 22:50:59 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-23 22:50:59.170570847 +0300 @@ -1682,10 +1682,14 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 length 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 ] 1505 main.lock_sync [ pass ] 681 main.partition_innodb_semi_consistent [ pass ] 10099 main.mdl_sync [ pass ] 1890 main.crash_commit_before [ pass ] 259 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:51:22 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-23 22:51:21.958537520 +0300 @@ -1567,10 +1567,14 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 @@ -5294,7 +5298,7 @@ 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` +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 `u` # Test normal utf8 SET NAMES utf8; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; @@ -5352,7 +5356,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5371,13 +5377,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +5431,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5444,7 +5456,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5473,14 +5487,18 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5571,7 +5589,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5590,13 +5610,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +5664,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5663,7 +5689,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5692,14 +5720,18 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5790,7 +5822,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5809,13 +5843,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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; 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-23 22:51:23 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-23 22:51:23.092975565 +0300 @@ -1592,10 +1592,14 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 length 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 ] 262 main.ps_3innodb [ pass ] 245 main.strict [ pass ] 98 main.bootstrap [ pass ] 9804 main.multidelete_engine 'aria' [ pass ] 26 main.spatial_utility_function_collect 'aria' [ pass ] 23 main.vector 'aria' [ pass ] 196 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 337 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'innodb' [ pass ] 62 main.multidelete_engine 'innodb' [ pass ] 19 main.spatial_utility_function_collect 'innodb' [ pass ] 37 main.vector 'innodb' [ pass ] 531 main.multidelete_engine 'heap' [ pass ] 6 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 101 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'myisam' [ pass ] 59 main.multidelete_engine 'myisam' [ pass ] 7 main.spatial_utility_function_collect 'myisam' [ pass ] 18 main.vector 'myisam' [ pass ] 142 main.userstat [ pass ] 1108 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:51:48 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-23 22:51:48.478405115 +0300 @@ -2464,7 +2464,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 +2486,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; @@ -2891,7 +2890,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 +2926,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 @@ -3367,7 +3366,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 @@ -4041,7 +4040,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: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'c' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.test" ReplayTest: At line 1138 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain [ fail ] Test ended at 2026-04-23 22:51:55 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-23 22:51:54.669509888 +0300 @@ -639,7 +639,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 +1264,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 +1294,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 ] 44 main.enforce_storage_engine_opt [ pass ] 25 main.log_state_bug33693 [ pass ] 8 main.log_tables-big [ pass ] 163034 main.mysql_client_test [ pass ] 36121 main.mysql_client_test_nonblock [ pass ] 36153 main.log_tables [ pass ] 15220 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:56:12 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-23 22:56:11.995868191 +0300 @@ -389,6 +389,9 @@ 3 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index 2 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index 2 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.Country with key_number: doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.Country with key_number: doesn't exist in list_index_read_costs select count(*) from CountryLanguage where @@ -501,7 +504,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 +514,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 +524,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 length 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 ] 16487 main.create_or_replace [ pass ] 238 main.mysql_upgrade-6984 [ pass ] 2407 main.innodb_load_xa [ skipped ] Need InnoDB plugin main.innodb_ignore_builtin [ pass ] 3 main.init_file [ pass ] 10 main.init_file_longline_3816 [ pass ] 35 ReplayTest: Loading context main.init_connection_query_cache [ pass ] 53 main.init_connect [ pass ] 101 main.ctype_utf8mb4_0900_mem [ pass ] 62 main.delayed_blob [ pass ] 33 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: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:56:47 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-23 22:56:47.240718115 +0300 @@ -459,8 +459,9 @@ (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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1089. # After Analyze, Query 4 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -861,8 +862,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. # Part 2, join_cache_level=3, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -939,8 +941,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. # 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 +1072,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. # Part 2, join_cache_level=4, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -1147,8 +1151,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. # 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 +1276,12 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2528. +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.Country doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City with key_number:\0002, records: + doesn't exist in list_index_read_costs # Part 2, join_cache_level=4, Query 10 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1301,8 +1310,9 @@ (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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1254. # 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 +1349,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1413,8 +1424,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1536,8 +1548,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1610,8 +1623,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1733,8 +1747,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1807,8 +1822,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1930,8 +1946,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2004,8 +2021,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2131,8 +2149,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2205,8 +2224,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2235,8 +2255,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2309,8 +2330,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2339,8 +2361,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2413,8 +2436,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2443,8 +2467,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2517,8 +2542,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2547,8 +2573,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2621,8 +2648,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2651,8 +2679,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2725,8 +2754,9 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 483. SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2958,8 +2988,12 @@ 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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2626. +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.Country doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City with key_number:\0002, records: + doesn't exist in list_index_read_costs EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -2967,8 +3001,9 @@ (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 +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1259. 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 +3790,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 +3803,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 +3952,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 +3988,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; # @@ -6059,7 +6092,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(*) 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-23 22:56:51 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-23 22:56:50.895700467 +0300 @@ -4504,7 +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 +1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 10.00 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' analyze select * from t1_bin where a between 'a-3a' and 'zzzzzzzzz'; Result content 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-23 22:56:49 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-23 22:56:49 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-23 22:56:49 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-23 22:56:49 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: String or number expected at offset 27. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. 2026-04-23 22:56:50 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. 2026-04-23 22:56:50 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 ] 2148 main.analyze_stmt_prefetch_count [ pass ] 2220 main.host_cache_size_functionality [ pass ] 1337 main.long_unique_innodb [ pass ] 8140 main.insert_debug [ pass ] 29 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:57:14 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-23 22:57:13.756915057 +0300 @@ -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 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-23 22:57:17 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-23 22:57:17.360976155 +0300 @@ -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) @@ -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; @@ -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; @@ -284,6 +284,9 @@ 1 SIMPLE part range i_p_retailprice i_p_retailprice 9 NULL # Using where; Using index 1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const # Using index 1 SIMPLE lineitem ref i_l_partkey i_l_partkey 9 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey # Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs flush status; select o_orderkey, p_partkey from part use index (i_p_retailprice), @@ -495,7 +498,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t3 with key_number:\0001, records: doesn't exist in list_index_read_costs 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 ] 35 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-23 22:57:22 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-23 22:57:21.734050291 +0300 @@ -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 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-23 22:57:25 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-23 22:57:25.323111137 +0300 @@ -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) @@ -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; @@ -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; @@ -284,6 +284,9 @@ 1 SIMPLE part range i_p_retailprice i_p_retailprice 9 NULL # Using where; Using index 1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const # Using index 1 SIMPLE lineitem ref i_l_partkey i_l_partkey 9 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey # Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs flush status; select o_orderkey, p_partkey from part use index (i_p_retailprice), @@ -495,7 +498,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t3 with key_number:\0001, records: doesn't exist in list_index_read_costs 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 ] 40 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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' [ pass ] 6576 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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' [ pass ] 6627 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-23 22:57:42 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-23 22:57:41.813390710 +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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.test" ReplayTest: At line 114 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.test" ReplayTest: At line 146 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.costs [ fail ] Test ended at 2026-04-23 22:57:49 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-23 22:57:49.338518296 +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,7 @@ 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 +ReplayTest: Query error: Lost connection to server during query drop table t1; set global InnoDB.optimizer_disk_read_ratio=@save; # @@ -153,48 +152,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/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.delete_innodb' mysql-test-run: restarting replay server... Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 191282 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: 19071 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 mysql-test-run: replay server restarted (pid 191282) ReplayTest: Loading context ReplayTest: Loading context 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.delete_innodb [ pass ] 6337 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_join_order [ pass ] 1244 main.large_pages [ pass ] 25 main.flush_block_commit_notembedded [ pass ] 1195 main.drop_table_force [ pass ] 64 main.alter_table_online_debug 'binlog' [ pass ] 1944 main.innodb_mysql_lock2 [ pass ] 1048 main.alter_table_online 'binlog' [ pass ] 162 main.bug39022 [ pass ] 34 main.commit_1innodb [ pass ] 761 main.create_select [ pass ] 42 main.sp_trans [ pass ] 282 main.xa_binlog [ pass ] 30 main.partition_exchange [ pass ] 296 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.stat_tables_innodb [ fail ] Test ended at 2026-04-23 22:58:25 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-23 22:58:25.532957940 +0300 @@ -83,6 +83,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs 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 @@ -214,6 +217,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs 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 @@ -252,6 +258,15 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0002, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0002, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs select o_year, sum(case when nation = 'UNITED STATES' then volume else 0 end) / sum(volume) as mkt_share @@ -283,12 +298,16 @@ 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 part ALL PRIMARY NULL NULL NULL 200 Using where; Using temporary; Using filesort +1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 +1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 Using where 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 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.part.p_partkey,dbt3_s001.partsupp.ps_suppkey 8 1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs 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, @@ -301,14 +320,17 @@ 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 part ALL PRIMARY NULL NULL NULL 200 100.00 Using where; Using temporary; Using filesort +1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 +1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where 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 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.part.p_partkey,dbt3_s001.partsupp.ps_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 +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0004, records:u\0017 doesn't exist in list_index_read_costs +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`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`part`.`p_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, @@ -389,7 +411,10 @@ 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 +1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey4Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.lineitem with key_number:\0003, records:u\0017 doesn't exist in list_index_read_costs select o_orderkey, p_partkey from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' @@ -437,7 +462,7 @@ 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 +1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.stat_tables_innodb/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.stat_tables_innodb/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.selectivity_innodb [ fail ] Test ended at 2026-04-23 22:58:35 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-23 22:58:34.969118223 +0300 @@ -79,7 +79,7 @@ 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 part ALL PRIMARY NULL NULL NULL 200 4.17 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 @@ -602,8 +602,8 @@ 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.11Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 10.71 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 4.67Using 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 @@ -657,12 +657,15 @@ 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.40Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 25.00 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 2.00Using 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 +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs 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 @@ -712,12 +715,15 @@ 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.40Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 25.00 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 2.00Using 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 +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.part with key_number: doesn't exist in list_index_read_costs 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 @@ -841,7 +847,7 @@ 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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 50.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; @@ -2136,14 +2142,14 @@ 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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 100.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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 100.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; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb/' main.alter_table_online_debug 'nobinlog' [ pass ] 1982 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_explicit_prune [ fail ] Test ended at 2026-04-23 22:58:39 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-23 22:58:39.230190603 +0300 @@ -462,7 +462,9 @@ 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 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_explicit_prune/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_explicit_prune/' main.partition_icp [ pass ] 654 ReplayTest: Loading context main.partition_innodb2 [ pass ] 42 main.repair [ pass ] 1711 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.test" ReplayTest: At line 1124 ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.test" ReplayTest: At line 1128 ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.test" ReplayTest: At line 1132 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.multi_update [ fail ] Test ended at 2026-04-23 22:58:46 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-23 22:58:46.175308574 +0300 @@ -1179,94 +1179,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 # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.multi_update/' ReplayTest: Loading context main.query_cache [ pass ] 24693 main.alter_table_locknone [ pass ] 80 main.auto_increment_ranges_innodb [ pass ] 166 main.innodb_mysql_sync [ pass ] 15289 main.mysql_upgrade-20228 [ pass ] 990 main.mysql_upgrade_to_100502 [ pass ] 1068 main.partition_alter [ pass ] 174 main.partition_cache [ pass ] 105 main.partition_cache_innodb [ pass ] 865 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_datatype [ fail ] Test ended at 2026-04-23 22:59:34 CURRENT_TEST: main.partition_datatype --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_datatype.result 2026-04-17 18:40:40.464800231 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_datatype.reject 2026-04-23 22:59:33.721660277 +0300 @@ -567,7 +567,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 23:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort +1 SIMPLE t2 p-2011-MSK ALL NULL NULL NULL NULL 11 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 22:59:59' ORDER BY a, tz; a tz @@ -609,7 +609,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-03-26 23:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort +1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz; a tz @@ -626,7 +626,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1 ALL NULL NULL NULL NULL 18 Using where; Using filesort +1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 18 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz; a tz @@ -642,7 +642,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2 ALL NULL NULL NULL NULL 15 Using where; Using filesort +1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 15 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz; a tz @@ -659,7 +659,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 13 Using where; Using filesort +1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 13 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz; a tz @@ -674,7 +674,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 7 Using where; Using filesort +1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 7 Using where; Using filesort # Test end range changes DELETE FROM t2 WHERE a = 0; INSERT IGNORE INTO t2 VALUES ('1970-01-01 00:00:00', 'UTC'); @@ -973,7 +973,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 03:00:00' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort +1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2,pEnd,pMax ALL NULL NULL NULL NULL 11 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz; a tz @@ -983,7 +983,7 @@ SELECT * FROM t2 WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p-2011-MSK ALL NULL NULL NULL NULL 2 Using where; Using filesort +1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 2 Using where; Using filesort SELECT * FROM t2 WHERE a BETWEEN '2011-03-26 01:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz; a tz Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_datatype/' main.partition_debug_sync [ pass ] 35 main.partition_geometries [ pass ] 68 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_innodb [ pass ] 3017 main.partition_innodb_plugin [ pass ] 73 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.partition_mrr_innodb [ fail ] Test ended at 2026-04-23 22:59:39 CURRENT_TEST: main.partition_mrr_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_innodb.result 2026-04-02 14:38:09.430657448 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_innodb.reject 2026-04-23 22:59:39.163743557 +0300 @@ -130,7 +130,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; @@ -164,7 +164,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_mrr_innodb/' main.truncate-stale-6500 [ pass ] 29 main.type_datetime_hires [ pass ] 102 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.view [ fail ] Test ended at 2026-04-23 22:59:42 CURRENT_TEST: main.view --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/view.result 2026-04-17 18:40:40.529804247 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/view.reject 2026-04-23 22:59:42.487747545 +0300 @@ -2497,10 +2497,10 @@ 5 EXPLAIN SELECT MAX(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row EXPLAIN SELECT MAX(a) FROM v1; 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(a) FROM t1; MIN(a) 0 @@ -2509,10 +2509,10 @@ 0 EXPLAIN SELECT MIN(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row EXPLAIN SELECT MIN(a) FROM v1; 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 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (x varchar(10)); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.view/' main.information_schema_all_engines [ pass ] 7824 main.bug46760 [ pass ] 25 main.row-checksum-old [ pass ] 36 main.row-checksum [ pass ] 59 main.backup_locks [ pass ] 48742 main.backup_interaction [ pass ] 219 main.backup_lock [ pass ] 3587 main.backup_priv [ pass ] 32 main.backup_stages [ pass ] 15265 main.backup_syntax [ pass ] 28 main.innodb_mysql_lock [ pass ] 2088 main.mdl [ pass ] 54 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.index_merge_innodb [ fail ] Test ended at 2026-04-23 23:01:27 CURRENT_TEST: main.index_merge_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_innodb.result 2026-04-02 14:38:09.374657600 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_innodb.reject 2026-04-23 23:01:27.015571727 +0300 @@ -827,7 +827,7 @@ INSERT INTO t1 SELECT seq, seq, seq from seq_1_to_100; EXPLAIN SELECT * FROM t1 WHERE a='1' OR b < 5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL PRIMARY,b NULL NULL NULL 100 Using where +1 SIMPLE t1 index_merge PRIMARY,b b,PRIMARY 5,3074 NULL 5 Using sort_union(b,PRIMARY); Using where SELECT * FROM t1 WHERE a='1' OR b < 5; a b c 1 1 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.index_merge_innodb/' ReplayTest: Loading context main.rowid_filter_innodb_debug [ pass ] 224 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Restrictions imposed on recursive definitions are violated for table 'destinations' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: 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 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cte_recursive.test" ReplayTest: At line 2767 ReplayTest: Loading context ReplayTest: Loading context main.cte_recursive [ fail ] Test ended at 2026-04-23 23:01:34 CURRENT_TEST: main.cte_recursive --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cte_recursive.result 2026-04-17 18:40:40.371794484 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cte_recursive.reject 2026-04-23 23:01:34.196331705 +0300 @@ -882,7 +882,7 @@ 3 RECURSIVE UNION ALL NULL NULL NULL NULL 12 100.00 Using where; Using join buffer (flat, BNL join) NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' and `test`.`folks`.`dob` = DATE'2000-01-01' union /* select#3 */ select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestors` `a` where `a`.`father` = `p`.`id` or `a`.`mother` = `p`.`id`)/* select#1 */ select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` +Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' and `test`.`folks`.`dob` = DATE'2000-01-01' union /* select#3 */ select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestors` `a` where `a`.`father` = `test`.`p`.`id` or `a`.`mother` = `test`.`p`.`id`)/* select#1 */ select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` # recursive spec with two anchor selects and two recursive ones with recursive ancestor_ids (id) @@ -3215,15 +3215,7 @@ where r.city=b.departure and b.arrival not in (select city from destinations) ) select * from destinations; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 16 100.00 -2 DERIVED a ALL NULL NULL NULL NULL 16 100.00 Using where -3 RECURSIVE UNION b ALL NULL NULL NULL NULL 16 100.00 Using where -3 RECURSIVE UNION ref key0 key0 35 test.b.departure 1 100.00 -4 DEPENDENT SUBQUERY ALL NULL NULL NULL NULL 16 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 with recursive destinations(`city`,`legs`) as (/* select#2 */ select `test`.`a`.`arrival` AS `city`,1 AS `legs` from `test`.`flights` `a` where `test`.`a`.`departure` = 'Cairo' union /* select#3 */ select `test`.`b`.`arrival` AS `arrival`,`r`.`legs` + 1 AS `r.legs + 1` from `destinations` `r` join `test`.`flights` `b` where `r`.`city` = `test`.`b`.`departure` and !((`test`.`b`.`arrival`,(/* select#4 */ select `destinations`.`city` from `destinations` where trigcond(`test`.`b`.`arrival` = `destinations`.`city` or `destinations`.`city` is null) having trigcond(`destinations`.`city` is null)))))/* select#1 */ select `destinations`.`city` AS `city`,`destinations`.`legs` AS `legs` from `destinations` +ReplayTest: Query error: Restrictions imposed on recursive definitions are violated for table 'destinations' set standard_compliant_cte=default; drop table flights; # @@ -3863,7 +3855,7 @@ (select * from t1 where a=1 union select a+1 from cte where a<3) select * from t1 as t; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t ALL NULL NULL NULL NULL 4 100.00 +1 PRIMARY t ALL NULL NULL NULL NULL 0 0.00 Warnings: Note 1003 with recursive cte as (/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union /* select#3 */ select `cte`.`a` + 1 AS `a+1` from `cte` where `cte`.`a` < 3)/* select#1 */ select `test`.`t`.`a` AS `a` from `test`.`t1` `t` with recursive cte as @@ -3881,7 +3873,7 @@ ( select * from t2 union select s1.* from t2 as s1, cte where s1.i1 = cte.i2 ) select * from t2 as t; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t ALL NULL NULL NULL NULL 2 +1 PRIMARY t ALL NULL NULL NULL NULL 0 drop table t1,t2; # # MDEV-22042: ANALYZE of query using stored function and recursive CTE @@ -3911,13 +3903,7 @@ where (dt.a1) in (with recursive cte as (select a2 from t2 where a2='2' union select tt2.a2 from t2 tt2 join cte on tt2.b1=cte.a2) select a2 from cte); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -1 PRIMARY ref key0 key0 23 test.t1.a1 1 FirstMatch(t1) -3 DERIVED t2 const PRIMARY PRIMARY 22 const 1 Using index -4 RECURSIVE UNION ALL NULL NULL NULL NULL 2 Using where -4 RECURSIVE UNION tt2 ref b1 b1 23 cte.a2 1 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL +ReplayTest: Query error: FUNCTION test.f1 does not exist analyze format=json select fv from (select t1.a1, f1(t1.a2) fv from t1) dt where (dt.a1) in (with recursive cte as (select a2 from t2 where a2='2' @@ -4110,9 +4096,7 @@ FROM cte JOIN t3 ON t3.tm BETWEEN cte.st AND cte.fn) SELECT t1.* FROM t1 JOIN cte2 USING (YEAR) JOIN cte3 USING (YEAR); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -1 PRIMARY ref key0 key0 5 const 0 100.00 -1 PRIMARY ref key0 key0 5 const 0 100.00 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DERIVED t1 system NULL NULL NULL NULL 1 100.00 3 RECURSIVE UNION t1 system NULL NULL NULL NULL 1 100.00 3 RECURSIVE UNION ALL NULL NULL NULL NULL 2 100.00 Using where @@ -4122,7 +4106,7 @@ 5 DERIVED ALL NULL NULL NULL NULL 2 100.00 5 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 with recursive cte as (/* select#2 */ select year(`test`.`t1`.`d1`) AS `YEAR`,`test`.`t1`.`d1` AS `st`,`test`.`t1`.`d1` + interval 1 month AS `fn` from `test`.`t1` union all /* select#3 */ select year(`cte`.`st` + interval 1 month) AS `YEAR(cte.st + INTERVAL 1 MONTH)`,`cte`.`st` + interval 1 month AS `cte.st + INTERVAL 1 MONTH`,`test`.`t1`.`d2` + interval 1 day AS `t1.d2 + INTERVAL 1 DAY` from `cte` join `test`.`t1` where `cte`.`st` + interval 1 month < `test`.`t1`.`d2`), cte2 as (/* select#4 */ select `cte`.`YEAR` AS `YEAR`,count(0) AS `COUNT(*)` from `cte` join `test`.`t2` where `test`.`t2`.`tm` between `cte`.`st` and `cte`.`fn`), cte3 as (/* select#5 */ select `cte`.`YEAR` AS `YEAR`,count(0) AS `COUNT(*)` from `cte` join `test`.`t3` where `test`.`t3`.`tm` between `cte`.`st` and `cte`.`fn`)/* select#1 */ select 2018 AS `YEAR`,'2018-01-01' AS `d1`,'2018-09-20' AS `d2` from `cte2` join `cte3` where `cte3`.`YEAR` = 2018 and `cte2`.`YEAR` = 2018 +Note 1003 with recursive cte as (/* select#2 */ select year(`test`.`t1`.`d1`) AS `YEAR`,`test`.`t1`.`d1` AS `st`,`test`.`t1`.`d1` + interval 1 month AS `fn` from `test`.`t1` union all /* select#3 */ select year(`cte`.`st` + interval 1 month) AS `YEAR(cte.st + INTERVAL 1 MONTH)`,`cte`.`st` + interval 1 month AS `cte.st + INTERVAL 1 MONTH`,`test`.`t1`.`d2` + interval 1 day AS `t1.d2 + INTERVAL 1 DAY` from `cte` join `test`.`t1` where `cte`.`st` + interval 1 month < `test`.`t1`.`d2`), cte2 as (/* select#4 */ select `cte`.`YEAR` AS `YEAR`,count(0) AS `COUNT(*)` from `cte` join `test`.`t2` where `test`.`t2`.`tm` between `cte`.`st` and `cte`.`fn`), cte3 as (/* select#5 */ select `cte`.`YEAR` AS `YEAR`,count(0) AS `COUNT(*)` from `cte` join `test`.`t3` where `test`.`t3`.`tm` between `cte`.`st` and `cte`.`fn`)/* select#1 */ select NULL AS `YEAR`,'2018-01-01' AS `d1`,NULL AS `d2` from `cte2` join `cte3` where `cte3`.`YEAR` = NULL and `cte2`.`YEAR` = NULL PREPARE stmt FROM "WITH RECURSIVE cte AS (SELECT YEAR(t1.d1) AS YEAR, t1.d1 AS st, t1.d1 + INTERVAL 1 MONTH AS fn @@ -4368,7 +4352,7 @@ select 0 as b FROM dual union all select b FROM r_cte as t) select * from t1 as tt; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 4 +1 PRIMARY tt ALL NULL NULL NULL NULL 0 with h_cte as ( with recursive r_cte as ( select * from t1 as s @@ -4464,11 +4448,6 @@ explain with recursive cte as (select * from db1.t1 union select * from (select * from cte) as t) select * from cte; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 3 -2 DERIVED t1 ALL NULL NULL NULL NULL 3 -3 RECURSIVE UNION ALL NULL NULL NULL NULL 3 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL prepare stmt from "with recursive cte as (select * from db1.t1 union select * from (select * from cte) as t) select * from cte"; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.cte_recursive/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_mat.test" ReplayTest: At line 111 ReplayTest: Loading context ReplayTest: Query error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_mat.test" ReplayTest: At line 124 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_sj2_mat [ fail ] Test ended at 2026-04-23 23:01:36 CURRENT_TEST: main.subselect_sj2_mat --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_mat.result 2026-04-17 18:40:40.512803197 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_mat.reject 2026-04-23 23:01:35.958687080 +0300 @@ -968,9 +968,9 @@ WHERE a = d AND ( pk < 2 OR d = 'z' ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2) +1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary 1 PRIMARY t1 ref b b 4 test.t2.d 1 +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` explain @@ -980,8 +980,8 @@ ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index -1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary +1 PRIMARY t1 ref b b 4 test.t2.d 1 +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` SELECT * FROM t1 WHERE b IN ( @@ -1500,10 +1500,6 @@ WHERE t1.cat_id = t3.cat_id AND t3.cat_id IN (SELECT cat_id FROM t2) AND t3.sack_id = 33479 AND t3.kit_id = 6; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 5 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index -1 PRIMARY t2 ref cat_id cat_id 4 test.t3.cat_id 2 Using where; Using index; FirstMatch(t1) SELECT count(*) FROM t1, t3 WHERE t1.cat_id = t3.cat_id AND t3.cat_id IN (SELECT cat_id FROM t2) AND @@ -1516,10 +1512,6 @@ WHERE t1.cat_id = t3.cat_id AND t3.cat_id IN (SELECT cat_id FROM t4) AND t3.sack_id = 33479 AND t3.kit_id = 6; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 5 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index -1 PRIMARY t4 ref cat_id cat_id 4 test.t3.cat_id 1 Using index; FirstMatch(t1) SELECT count(*) FROM t1, t3 WHERE t1.cat_id = t3.cat_id AND t3.cat_id IN (SELECT cat_id FROM t4) AND Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj2_mat/' main.analyze_engine_stats 'slow_query_log_off' [ pass ] 1113 main.analyze_engine_stats 'slow_query_log_on' [ pass ] 1105 main.stat_tables_innodb_debug [ pass ] 30 ReplayTest: Loading context ReplayTest: Loading context 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.delete_use_source [ fail ] Test ended at 2026-04-23 23:01:55 CURRENT_TEST: main.delete_use_source --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_use_source.result 2026-04-17 18:40:40.384795287 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_use_source.reject 2026-04-23 23:01:55.381945379 +0300 @@ -49,8 +49,12 @@ start transaction; explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range c1 c1 4 NULL 600 Using index condition; Using where +1 PRIMARY t1 range c1 c1 4 NULL 1 Using index condition; Using where 2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 167 Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1.c1 doesn't exist in list of range contexts delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1; affected rows: 1 delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1; @@ -67,6 +71,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 range c1 c1 4 NULL # Using index condition; Using where 2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 # Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1.c1 doesn't exist in list of range contexts delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ; affected rows: 500 select count(*) from v1 where c1=0; @@ -244,8 +252,7 @@ explain delete from t1 using t1,t2 where t1.c2 = t2.c2 and t1.c1 > 1; 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 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables delete from t1 using t1,t2 where t1.c2 = t2.c2 and t1.c1 > 1; select * from t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete_use_source/' main.sum_distinct-big [ pass ] 145343 ReplayTest: Loading context ReplayTest: Loading context main.analyze [ pass ] 181 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.delete [ fail ] Test ended at 2026-04-23 23:04:30 CURRENT_TEST: main.delete --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete.result 2026-04-17 18:40:40.383795226 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete.reject 2026-04-23 23:04:30.345333377 +0300 @@ -584,7 +584,7 @@ create temporary table t select * from t1; explain delete from t1 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL 8 Deleting all rows +1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows delete from t1 order by c2; select *from t1; c1 c2 c3 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.derived_opt [ fail ] Test ended at 2026-04-23 23:04:33 CURRENT_TEST: main.derived_opt --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_opt.result 2026-04-17 18:40:40.391795720 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_opt.reject 2026-04-23 23:04:33.106349531 +0300 @@ -212,7 +212,7 @@ EXPLAIN SELECT MAX(b) FROM (SELECT * FROM t1) AS t WHERE a = 100; 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 MAX(b) FROM (SELECT * FROM t1) AS t WHERE a = 100; MAX(b) 5 @@ -670,18 +670,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "DT", - "key_name": "key0", - "key_parts": 1, - "select": - [ - "group_list_in_key", - "unhandled query" - ] - } -] +NULL # view/cte/derived merged inside our derived table create view v1 as select * from t1; explain @@ -742,16 +731,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "DT", - "key_name": "key0", - "key_parts": 2, - "select": - ["group_list_in_key"], - "rec_per_key_estimate": 1 - } -] +NULL explain select * from t2, @@ -786,19 +766,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "DT", - "key_name": "key0", - "key_parts": 1, - "select": - [ - "distinct_in_query_block", - "distinct_in_query_block" - ], - "rec_per_key_estimate": 2 - } -] +NULL drop table t1, t2; create table t1 ( @@ -861,24 +829,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "dt", - "key_name": "key0", - "key_parts": 2, - "select": - ["group_list_in_key"], - "rec_per_key_estimate": 1 - }, - { - "table_alias": "dt", - "key_name": "key1", - "key_parts": 2, - "select": - ["group_list_in_key"], - "rec_per_key_estimate": 1 - } -] +NULL # union with distinct rows explain select * from t1 @@ -901,30 +852,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "dt", - "key_name": "key1", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - }, - { - "table_alias": "dt", - "key_name": "key2", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - } -] +NULL # union without distinct rows explain select * from t1 @@ -946,30 +874,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "dt", - "key_name": "key0", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - }, - { - "table_alias": "dt", - "key_name": "key1", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - } -] +NULL # union without distinct rows with simple non grouping 2nd select explain select * from t1 @@ -991,28 +896,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "dt", - "key_name": "key0", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "unhandled query" - ] - }, - { - "table_alias": "dt", - "key_name": "key1", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "unhandled query" - ] - } -] +NULL # intersect explain select * from t1 @@ -1035,30 +919,7 @@ json_detailed(json_extract(trace, '$**.infer_derived_key_statistics')) as t from information_schema.optimizer_trace; t -[ - { - "table_alias": "dt", - "key_name": "key1", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - }, - { - "table_alias": "dt", - "key_name": "key2", - "key_parts": 2, - "select": - [ - "group_list_in_key", - "group_list_in_key" - ], - "rec_per_key_estimate": 2 - } -] +NULL drop table t1, t2, t3, t4; # # End of 11.4 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.derived_opt/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.derived_split_innodb [ pass ] 701 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.desc_index_min_max [ fail ] Test ended at 2026-04-23 23:04:35 CURRENT_TEST: main.desc_index_min_max --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/desc_index_min_max.result 2026-04-02 14:38:09.340657692 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/desc_index_min_max.reject 2026-04-23 23:04:35.486363805 +0300 @@ -5,55 +5,55 @@ insert into t1 select seq * 2 from seq_1_to_100 order by rand(1); explain select max(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select max(a) from t1; max(a) 200 explain select min(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(a) from t1; min(a) 2 explain select max(a) from t1 where a < 100; 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 max(a) from t1 where a < 100; max(a) 98 explain select min(a) from t1 where a > 100; 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(a) from t1 where a > 100; min(a) 102 explain select max(a) from t1 where a <= 100; 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 max(a) from t1 where a <= 100; max(a) 100 explain select min(a) from t1 where a >= 100; 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(a) from t1 where a >= 100; min(a) 100 explain select max(a) from t1 where a <= 99; 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 max(a) from t1 where a <= 99; max(a) 98 explain select min(a) from t1 where a >= 99; 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(a) from t1 where a >= 99; min(a) 100 explain select max(a) from t1 where a > 100; 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 max(a) from t1 where a > 100; max(a) 200 @@ -65,7 +65,7 @@ NULL explain select min(a) from t1 where a < 100; 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(a) from t1 where a < 100; min(a) 2 @@ -77,7 +77,7 @@ NULL explain select max(a) from t1 where a >= 100; 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 max(a) from t1 where a >= 100; max(a) 200 @@ -89,7 +89,7 @@ NULL explain select min(a) from t1 where a <= 100; 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(a) from t1 where a <= 100; min(a) 2 @@ -101,13 +101,13 @@ NULL explain select max(a) from t1 where a >= 99; 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 max(a) from t1 where a >= 99; max(a) 200 explain select min(a) from t1 where a <= 99; 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(a) from t1 where a <= 99; min(a) 2 @@ -127,13 +127,13 @@ insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1); explain select max(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select max(a) from t1; max(a) 200 explain select min(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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(a) from t1; min(a) 2 @@ -141,13 +141,13 @@ insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1); explain select max(b) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select max(b) from t1; max(b) 200 explain select min(b) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(b) from t1; min(b) 2 @@ -155,13 +155,13 @@ insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1); explain select max(b) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select max(b) from t1; max(b) 200 explain select min(b) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(b) from t1; min(b) 2 @@ -169,7 +169,7 @@ INSERT INTO t1 VALUES (0.1234),(0.6789); explain SELECT MAX(a) FROM t1 WHERE a <= 0.6789; 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 MAX(a) FROM t1 WHERE a <= 0.6789; MAX(a) 0.6789 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.desc_index_min_max/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.desc_index_range [ fail ] Test ended at 2026-04-23 23:04:37 CURRENT_TEST: main.desc_index_range --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/desc_index_range.result 2026-04-17 18:40:40.394795906 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/desc_index_range.reject 2026-04-23 23:04:36.598370575 +0300 @@ -10,13 +10,7 @@ select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - [ - "(6) <= (a DESC) <= (6)", - "(4) <= (a DESC) <= (4)", - "(2) <= (a DESC) <= (2)" - ] -] +NULL set optimizer_trace=default; # These should go in reverse order: select * from t1 force index(a) where a in (2, 4, 6); @@ -41,18 +35,14 @@ select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - ["(8) <= (a)"] -] +NULL explain select * from t1 force index(ab) where a>=8 and b<=50; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ab ab 8 NULL 46 Using where; Using index select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - ["(8,50) <= (a,b DESC)"] -] +NULL select * from t1 force index(ab) where a>=8 and b<=50; a b 8 50 @@ -94,9 +84,7 @@ select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - ["(2,80) <= (a,b DESC) <= (4,50)"] -] +NULL select * from t1 where a between 2 and 4 and b between 50 and 80; a b 2 80 @@ -125,9 +113,7 @@ select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - ["(4) <= (a DESC) <= (2)"] -] +NULL explain select * from t2 where a between 2 and 4 and b between 50 and 80; id select_type table type possible_keys key key_len ref rows Extra @@ -135,9 +121,7 @@ select json_detailed(json_extract(trace, '$**.range_access_plan.ranges')) as jd from information_schema.optimizer_trace; jd -[ - ["(4,80) <= (a DESC,b DESC) <= (2,50)"] -] +NULL drop table t2; # # "Using index for group-by" was disabled for reverse index but @@ -151,18 +135,7 @@ select json_detailed(json_extract(trace, '$**.potential_group_range_indexes')) as jd from information_schema.optimizer_trace; jd -[ - [ - { - "index": "PRIMARY", - "covering": true, - "ranges": - ["(2) <= (p) <= (2)"], - "rows": 1, - "cost": 0.000838227 - } - ] -] +NULL drop table t1; set optimizer_trace=default; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.desc_index_range/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_innodb [ fail ] Test ended at 2026-04-23 23:04:38 CURRENT_TEST: main.group_min_max_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max_innodb.result 2026-04-02 14:38:09.371657608 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max_innodb.reject 2026-04-23 23:04:38.032379398 +0300 @@ -324,7 +324,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where 1 PRIMARY ref key0 key0 6 test.t1.b # -2 DERIVED t2 range a a 58 NULL # Using index for group-by; Using temporary; Using filesort +2 DERIVED t2 range NULL a 58 NULL # Using index for group-by; Using temporary; Using filesort SELECT t1.a FROM (SELECT a FROM t2 GROUP BY a ORDER BY COUNT(DISTINCT b) LIMIT 1) dt JOIN t1 ON dt.a=t1.b; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_min_max_innodb/' main.group_min_max_notembedded [ pass ] 18 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.index_merge_innodb_notembedded [ fail ] Test ended at 2026-04-23 23:04:39 CURRENT_TEST: main.index_merge_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_innodb_notembedded.result 2026-04-02 14:38:09.374657600 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_innodb_notembedded.reject 2026-04-23 23:04:39.111386111 +0300 @@ -24,16 +24,10 @@ from INFORMATION_SCHEMA.OPTIMIZER_TRACE); select json_detailed(json_extract(@trace, '$[*].index')) as INDEXES; INDEXES -[ - "idx_status", - "idx_country_code_status_id" -] +NULL select json_detailed(json_extract(@trace, '$[*].rowid_ordered')) as ROR; ROR -[ - true, - false -] +NULL DROP table t1; # Now, try with indexes using ASC ordering and PK using DESC CREATE TABLE t1 ( @@ -56,16 +50,10 @@ from INFORMATION_SCHEMA.OPTIMIZER_TRACE); select json_detailed(json_extract(@trace, '$[*].index')) as INDEXES; INDEXES -[ - "idx_status", - "idx_country_code_status_id" -] +NULL select json_detailed(json_extract(@trace, '$[*].rowid_ordered')) as ROR; ROR -[ - true, - false -] +NULL DROP TABLE t1; # Now, try with indexes using DESC ordering and PK using DESC CREATE TABLE t1 ( @@ -88,15 +76,9 @@ from INFORMATION_SCHEMA.OPTIMIZER_TRACE); select json_detailed(json_extract(@trace, '$[*].index')) as INDEXES; INDEXES -[ - "idx_status", - "idx_country_code_status_id" -] +NULL select json_detailed(json_extract(@trace, '$[*].rowid_ordered')) as ROR; ROR -[ - true, - false -] +NULL DROP TABLE t1; SET sort_buffer_size= @save_sort_buffer_size; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.index_merge_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: Loading context ReplayTest: Loading context ReplayTest: Loading context main.information_schema [ pass ] 3773 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_icp [ pass ] 1009 ReplayTest: Loading context ReplayTest: Loading context main.join_optimizer [ pass ] 145 main.log_slow_innodb [ pass ] 266 main.opt_context_load_stats_innodb [ pass ] 456 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_ctx_replay_innodb_complement [ pass ] 450 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_ctx_replay_innodb_preferably [ pass ] 452 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_split_materialized [ pass ] 636 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Table 'seq_1_to_10000' already exists ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/optimizer_costs.test" ReplayTest: At line 150 ReplayTest: Loading context ReplayTest: Query error: Table 'seq_1_to_10000' already exists ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/optimizer_costs.test" ReplayTest: At line 156 ReplayTest: Loading context 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.optimizer_costs [ fail ] Test ended at 2026-04-23 23:04:50 CURRENT_TEST: main.optimizer_costs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/optimizer_costs.result 2026-04-02 14:38:09.422657470 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/optimizer_costs.reject 2026-04-23 23:04:50.055457346 +0300 @@ -280,22 +280,16 @@ PRIMARY KEY (l_orderkey)) engine=aria; insert into t1 select seq,seq,seq from seq_1_to_1000; explain select straight_join count(*) from seq_1_to_10000,t1 where seq=l_orderkey; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE seq_1_to_10000 index PRIMARY PRIMARY 8 NULL 10000 Using index -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.seq_1_to_10000.seq 1 Using where; Using index show status like "last_query_cost"; Variable_name Value -Last_query_cost 5.641229 +Last_query_cost 0.024323 set @org_cost=@@aria.optimizer_key_next_find_cost; set global aria.optimizer_key_next_find_cost=1000; flush tables; explain select count(*) from seq_1_to_10000,t1 where seq=l_orderkey; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE seq_1_to_10000 index PRIMARY PRIMARY 8 NULL 10000 Using index -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.seq_1_to_10000.seq 1 Using where; Using index show status like "last_query_cost"; Variable_name Value -Last_query_cost 5.641229 +Last_query_cost 0.024323 set global aria.optimizer_key_next_find_cost=@org_cost; drop table t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.optimizer_costs/' ReplayTest: Loading context main.optimizer_costs_innodb [ pass ] 614 ReplayTest: Loading context main.optimizer_crash [ pass ] 118 ReplayTest: Loading context 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.order_by_innodb [ pass ] 1117 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.order_by_optimizer_innodb [ pass ] 319 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.range [ fail ] Test ended at 2026-04-23 23:04:59 CURRENT_TEST: main.range --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range.result 2026-04-17 18:40:40.478801096 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range.reject 2026-04-23 23:04:59.157520515 +0300 @@ -637,13 +637,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 11 const 2 Using index condition explain select * from t1 where a='aaa' collate latin1_bin; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 11 const 2 Using index condition +ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' explain select * from t1 where a='aaa' collate latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where -Warnings: -Note 1105 Cannot use key `a` part[0] for lookup: `test`.`t1`.`a` of collation `latin1_swedish_ci` = "'aaa' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' drop table t1; CREATE TABLE t1 ( `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000', @@ -2128,13 +2124,17 @@ explain SELECT * FROM t1 WHERE fd='😁'; 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 ix_fd ix_fd 63 const 1 Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ix_fd doesn't exist in list of range contexts SELECT * FROM t1 WHERE fd='😁'; id fd # The following must not use range access: explain select count(*) from t1 where fd <'😁'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ix_fd ix_fd 63 NULL # Using where; Using index +1 SIMPLE t1 range ix_fd ix_fd 63 NULL # Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ix_fd doesn't exist in list of range contexts select count(*) from t1 where fd <'😁'; count(*) 40960 @@ -2384,7 +2384,9 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'); EXPLAIN SELECT * FROM t1 WHERE a<=>'😎'; 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 a a 33 const 1 Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.a doesn't exist in list of range contexts DROP TABLE t1; # # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in @@ -3725,7 +3727,7 @@ # no filesort, rows should be 75 not 500 explain SELECT * FROM t1,t2 WHERE t1.id=t2.id AND t1.col=2 ORDER BY t2.id LIMIT 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range key1 key1 5 NULL 74 Using index condition; Using where +1 SIMPLE t1 range key1 key1 5 NULL 74 Using where 1 SIMPLE t2 ref id id 5 test.t1.id 2 SELECT * FROM t1,t2 WHERE t1.id=t2.id AND t1.col=2 ORDER BY t2.id LIMIT 10; id col id col Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.range/' 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.range_innodb [ pass ] 8473 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.range_mrr_icp [ fail ] Test ended at 2026-04-23 23:05:14 CURRENT_TEST: main.range_mrr_icp --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_mrr_icp.result 2026-04-17 18:40:40.480801219 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_mrr_icp.reject 2026-04-23 23:05:14.108630712 +0300 @@ -640,13 +640,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 11 const 2 Using index condition explain select * from t1 where a='aaa' collate latin1_bin; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 11 const 2 Using index condition +ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' explain select * from t1 where a='aaa' collate latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where -Warnings: -Note 1105 Cannot use key `a` part[0] for lookup: `test`.`t1`.`a` of collation `latin1_swedish_ci` = "'aaa' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' drop table t1; CREATE TABLE t1 ( `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000', @@ -2131,13 +2127,17 @@ explain SELECT * FROM t1 WHERE fd='😁'; 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 ix_fd ix_fd 63 const 1 Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ix_fd doesn't exist in list of range contexts SELECT * FROM t1 WHERE fd='😁'; id fd # The following must not use range access: explain select count(*) from t1 where fd <'😁'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ix_fd ix_fd 63 NULL # Using where; Using index +1 SIMPLE t1 range ix_fd ix_fd 63 NULL # Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ix_fd doesn't exist in list of range contexts select count(*) from t1 where fd <'😁'; count(*) 40960 @@ -2387,7 +2387,9 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'); EXPLAIN SELECT * FROM t1 WHERE a<=>'😎'; 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 a a 33 const 1 Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.a doesn't exist in list of range contexts DROP TABLE t1; # # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in @@ -3723,7 +3725,7 @@ # no filesort, rows should be 75 not 500 explain SELECT * FROM t1,t2 WHERE t1.id=t2.id AND t1.col=2 ORDER BY t2.id LIMIT 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range key1 key1 5 NULL 74 Using index condition; Using where +1 SIMPLE t1 range key1 key1 5 NULL 74 Using where 1 SIMPLE t2 ref id id 5 test.t1.id 2 SELECT * FROM t1,t2 WHERE t1.id=t2.id AND t1.col=2 ORDER BY t2.id LIMIT 10; id col id col Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.range_mrr_icp/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.range_vs_index_merge_innodb [ fail ] Test ended at 2026-04-23 23:05:26 CURRENT_TEST: main.range_vs_index_merge_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_vs_index_merge_innodb.result 2026-04-02 14:38:09.446657405 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_vs_index_merge_innodb.reject 2026-04-23 23:05:26.197724661 +0300 @@ -54,14 +54,18 @@ WHERE (Population >= 100000 OR Name LIKE 'P%') AND Country='CAN' OR (Population < 100000 OR Name Like 'T%') AND Country='ARG'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Country 3 NULL 106 Using index condition; Using where +1 SIMPLE City range Population,Country,Name Country 3 NULL 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1848. EXPLAIN SELECT * FROM City WHERE Population < 200000 AND Name LIKE 'P%' AND (Population > 300000 OR Name LIKE 'T%') AND (Population < 100000 OR Name LIKE 'Pa%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Name 35 NULL 236 Using index condition; Using where +1 SIMPLE City range Population,Name Population 4 NULL 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Population > 100000 AND Name LIKE 'Aba%' OR @@ -69,7 +73,9 @@ Country <= 'ALB' AND Name LIKE 'L%' OR ID BETWEEN 3807 AND 3810; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 35,3,4 NULL 32 Using sort_union(Name,Country,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,Country,PRIMARY 4,3,4 NULL 3 Using sort_union(Population,Country,PRIMARY); Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1248. EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 115000); @@ -212,7 +218,7 @@ WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR (Name BETWEEN 'P' AND 'S' AND (Population > 103000 AND Population < 104000)); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Name,Population 35,4 NULL 60 Using sort_union(Name,Population); Using where +1 SIMPLE City index_merge Population,Country,Name Country,Population 3,4 NULL 144 Using sort_union(Country,Population); Using where EXPLAIN SELECT * FROM City WHERE (Name < 'Bb' AND (Country > 'A' AND Country < 'B')) OR @@ -348,32 +354,42 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'H%' OR Name LIKE 'P%' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 395 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 674. EXPLAIN SELECT * FROM City WHERE Name LIKE 'Ha%' OR Name LIKE 'Pa%' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 133 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 675. EXPLAIN SELECT * FROM City WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 110) AND (Name LIKE 'P%' OR (Population > 103000 AND Population < 104000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 20 Using where +1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 1 Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1830. EXPLAIN SELECT * FROM City WHERE ((ID < 800) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 900 AND 1500) AND (Name LIKE 'Pa%' OR (Population > 103000 AND Population < 105000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 39,3,4 NULL 683 Using sort_union(Name,Country,PRIMARY); Using where +1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 1 Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1839. EXPLAIN SELECT * FROM City WHERE ((ID < 200) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 200) AND (Name LIKE 'Pa%' OR (Population > 103200 AND Population < 104000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 200 Using where +1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 1 Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1781. SELECT * FROM City USE INDEX () WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 110) AND @@ -613,7 +629,9 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'P%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 236 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 674. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 102000) AND @@ -621,7 +639,9 @@ ((ID BETWEEN 3400 AND 3800) AND (Country < 'AGO' OR Name LIKE 'Pa%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,PRIMARY 4,4 NULL 440 Using sort_union(Population,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,PRIMARY 4,4 NULL 2 Using sort_union(Population,PRIMARY); Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4636. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) AND @@ -629,7 +649,9 @@ ((ID BETWEEN 3790 AND 3800) AND (Country < 'C' OR Name LIKE 'P%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name,PRIMARY 3,35,4 NULL 87 Using sort_union(Country,Name,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,PRIMARY 4,4 NULL 2 Using sort_union(Population,PRIMARY); Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4630. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 AND Population < 102000) AND (Country < 'C' OR Name BETWEEN 'P' AND 'S')) OR @@ -684,11 +706,15 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'Pas%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 8 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 789. EXPLAIN SELECT * FROM City WHERE Name LIKE 'P%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 236 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 787. EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 103000); id select_type table type possible_keys key key_len ref rows Extra @@ -706,13 +732,17 @@ WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%') AND Country='USA'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name,CountryPopulation CountryPopulation,Name 7,35 NULL 18 Using sort_union(CountryPopulation,Name); Using where +1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4268. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'P%') AND Country='EST'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 2 Using index condition; Using where +1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4252. SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%') AND Country='USA'; @@ -801,7 +831,9 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'Pa%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 71 Using index condition +1 SIMPLE City range Name Name 35 NULL 1 Using index condition +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 895. set @tmp_range_vs_index_merge=@@optimizer_switch; set optimizer_switch='extended_keys=off'; EXPLAIN @@ -810,14 +842,18 @@ ID BETWEEN 3790 AND 3800) AND Country='USA' AND (Name LIKE 'Pa%' OR ID BETWEEN 4025 AND 4035); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryPopulation,PRIMARY 7,4 NULL 14 Using sort_union(CountryPopulation,PRIMARY); Using where +1 SIMPLE City ref PRIMARY,Population,Country,Name,CountryPopulation,CountryName Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7818. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR ID BETWEEN 3790 AND 3800) AND Country='USA' AND (Name LIKE 'Pa%' OR ID BETWEEN 4028 AND 4032); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName,PRIMARY 38,4 NULL 10 Using sort_union(CountryName,PRIMARY); Using where +1 SIMPLE City ref PRIMARY,Population,Country,Name,CountryPopulation,CountryName Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7817. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) OR @@ -873,7 +909,9 @@ ID BETWEEN 3790 AND 3800) AND Country='USA' OR (Name LIKE 'Pa%' OR ID BETWEEN 250 AND 260) AND Country='BRA'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryPopulation,CountryName,PRIMARY 7,38,4 NULL 36 Using sort_union(CountryPopulation,CountryName,PRIMARY); Using where +1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName Country 3 NULL 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7910. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 and Population < 102000) OR ID BETWEEN 3790 AND 3800) AND Country='USA' @@ -956,14 +994,18 @@ ID BETWEEN 3500 AND 3800) AND Country='USA' AND (Name LIKE 'P%' OR ID BETWEEN 4000 AND 4300); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName 38 NULL 18 Using index condition +1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName PRIMARY 4 NULL 1 Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2033. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 11000) OR ID BETWEEN 3500 AND 3800) AND Country='USA' AND (Name LIKE 'Pho%' OR ID BETWEEN 4000 AND 4300); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName Name 35 NULL 1 Using index condition; Using where +1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName PRIMARY 4 NULL 1 Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2035. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 AND Population < 11000) OR ID BETWEEN 3500 AND 3800) AND Country='USA' @@ -998,7 +1040,9 @@ WHERE Country='USA' AND Population BETWEEN 101000 AND 102000 OR Country='USA' AND Name LIKE 'Pa%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Country,CountryPopulation,CountryName CountryPopulation,CountryName 7,38 NULL 8 Using sort_union(CountryPopulation,CountryName); Using where +1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 5355. SELECT * FROM City USE INDEX() WHERE Country='USA' AND Population BETWEEN 101000 AND 102000 OR Country='USA' AND Name LIKE 'Pa%'; @@ -1028,7 +1072,9 @@ WHERE Country='USA' AND (Population BETWEEN 101000 AND 102000 OR Name LIKE 'Pa%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Country,CountryPopulation,CountryName CountryPopulation,CountryName 7,38 NULL 8 Using sort_union(CountryPopulation,CountryName); Using where +1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 1 Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 5355. SELECT * FROM City WHERE Country='USA' AND (Population BETWEEN 101000 AND 102000 OR Name LIKE 'Pa%'); @@ -1084,7 +1130,7 @@ (Name='Samara' AND Country='RUS') OR (Name='Seattle' AND Country='USA'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CountryName 38 NULL 27 Using index condition +1 SIMPLE City index_merge Country,CountryPopulation,CountryName,CityName CityName,CountryName 35,38 NULL 28 Using sort_union(CityName,CountryName); Using where SELECT Name, Country, Population FROM City WHERE (Name='Manila' AND Country='PHL') OR (Name='Addis Abeba' AND Country='ETH') OR Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.range_vs_index_merge_innodb/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.secondary_key_costs [ pass ] 163 ReplayTest: Loading context ReplayTest: Loading context main.subselect_elimination [ 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 main.subselect_innodb [ fail ] Test ended at 2026-04-23 23:05:34 CURRENT_TEST: main.subselect_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_innodb.result 2026-04-02 14:38:09.483657304 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_innodb.reject 2026-04-23 23:05:33.736785075 +0300 @@ -422,8 +422,8 @@ explain select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 group by a1)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using temporary; Using filesort select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 group by a1)); 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_innodb/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_sj2 [ fail ] Test ended at 2026-04-23 23:05:35 CURRENT_TEST: main.subselect_sj2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2.result 2026-04-02 14:38:09.487657294 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2.reject 2026-04-23 23:05:35.226797164 +0300 @@ -966,9 +966,9 @@ WHERE a = d AND ( pk < 2 OR d = 'z' ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2) +1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary 1 PRIMARY t1 ref b b 4 test.t2.d 1 +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` explain @@ -978,8 +978,8 @@ ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index -1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary +1 PRIMARY t1 ref b b 4 test.t2.d 1 +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` SELECT * FROM t1 WHERE b IN ( Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj2/' ReplayTest: Loading context ReplayTest: Query error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_jcl6.test at line 18: ReplayTest: At line 55 ReplayTest: Loading context ReplayTest: Query error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_jcl6.test at line 18: ReplayTest: At line 71 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_jcl6.test" ReplayTest: At line 47 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_sj2_jcl6 [ fail ] Test ended at 2026-04-23 23:05:37 CURRENT_TEST: main.subselect_sj2_jcl6 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_jcl6.result 2026-04-02 14:38:09.487657294 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj2_jcl6.reject 2026-04-23 23:05:36.782809837 +0300 @@ -60,9 +60,6 @@ 18 13 19 14 explain select * from t2 where b in (select a from t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL b NULL NULL NULL 20 Using where -1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.b 7 Using where; FirstMatch(t2); Using join buffer (flat, BNLH join) select * from t2 where b in (select a from t1); a b 1 1 @@ -87,9 +84,6 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain select * from t3 where b in (select a from t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL 20 Using where -1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t3.b 7 Using where; FirstMatch(t3); Using join buffer (flat, BNLH join) select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -973,9 +967,9 @@ WHERE a = d AND ( pk < 2 OR d = 'z' ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2) +1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary 1 PRIMARY t1 ref b b 4 test.t2.d 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` explain @@ -985,8 +979,8 @@ ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary -1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index -1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t1 ref b b 4 test.t2.d 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; End temporary Warnings: Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int` SELECT * FROM t1 WHERE b IN ( @@ -1439,11 +1433,6 @@ EXPLAIN SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b WHERE c IN (SELECT t4.b FROM t4 JOIN t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3); Using join buffer (incremental, BNL join) -1 PRIMARY t1 ref b b 4 test.t3.b 1 Using index SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b WHERE c IN (SELECT t4.b FROM t4 JOIN t2); b c Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj2_jcl6/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.update [ fail ] Test ended at 2026-04-23 23:05:43 CURRENT_TEST: main.update --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update.result 2026-04-17 18:40:40.525804000 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update.reject 2026-04-23 23:05:43.063861483 +0300 @@ -752,10 +752,10 @@ update t1 set a1 = 'u' where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 50.00 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 50.00 Using where Warnings: -Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a1` = 'u' where `test`.`t1`.`a2` like 'xx%' +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a1` = 'u' where 0 update t1 set a1 = 'u' where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); select * from t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.update/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 15: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 24: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 33: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 33: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 77 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 40: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 93 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 110 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: In included file "./include/update_use_source_cases.inc": ReplayTest: included from ./include/update_use_source.inc at line 48: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.test at line 42: ReplayTest: At line 128 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.update_use_source [ fail ] Test ended at 2026-04-23 23:05:48 CURRENT_TEST: main.update_use_source --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.result 2026-04-02 14:38:09.508657237 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_use_source.reject 2026-04-23 23:05:48.063960162 +0300 @@ -332,9 +332,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -390,9 +388,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -448,10 +444,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -793,12 +786,12 @@ test.t1 analyze status OK explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; affected rows: 20 info: Rows matched: 20 Changed: 20 Warnings: 0 @@ -849,13 +842,13 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a range t1_c2 t1_c2 5 NULL 20 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a range t1_c2 t1_c2 5 NULL 20 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; affected rows: 20 @@ -966,9 +959,7 @@ 1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8 explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where -2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -1024,9 +1015,7 @@ 1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -1082,10 +1071,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition -3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -1605,9 +1591,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 29 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -1663,9 +1647,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -1721,10 +1703,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -2879,9 +2858,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -2937,9 +2914,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -2995,10 +2970,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -3340,12 +3312,12 @@ test.t1 analyze status OK explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; affected rows: 20 info: Rows matched: 20 Changed: 20 Warnings: 0 @@ -3396,13 +3368,13 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a range t1_c2 t1_c2 5 NULL 21 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a range t1_c2 t1_c2 5 NULL 21 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; affected rows: 20 @@ -3513,9 +3485,7 @@ 1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8 explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where -2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -3571,9 +3541,7 @@ 1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -3629,10 +3597,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition -3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -4152,9 +4117,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 30 Using index condition; Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -4210,9 +4173,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -4268,10 +4229,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -5426,9 +5384,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -5484,9 +5440,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -5542,10 +5496,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -5887,12 +5838,12 @@ test.t1 analyze status OK explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3; affected rows: 20 info: Rows matched: 20 Changed: 20 Warnings: 0 @@ -5943,13 +5894,13 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan; Using filesort +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; LooseScan; Using filesort +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 5 update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; affected rows: 20 @@ -6060,9 +6011,7 @@ 1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8 explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where -2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -6118,9 +6067,7 @@ 1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -6176,10 +6123,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition -3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -6699,9 +6643,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -6757,9 +6699,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -6815,10 +6755,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -7973,9 +7910,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -8031,9 +7966,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -8089,10 +8022,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -8549,9 +8479,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 explain update t1 set c1=c1 +(select max(a.c2) from v1 a where a.c1 = t1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts update t1 set c1=c1 +(select max(a.c2) from v1 a where a.c1 = t1.c1); affected rows: 32 @@ -8602,11 +8530,11 @@ explain select * from v1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL t1_c2 NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -8659,11 +8587,12 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where 1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 FirstMatch(t1) +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 2 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -8715,13 +8644,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL t1_c2 NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); @@ -9238,9 +9167,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3; affected rows: 7 @@ -9296,9 +9223,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1); affected rows: 1 @@ -9354,10 +9279,7 @@ explain update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where -3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where +ReplayTest: Query error: Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts update v1 set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1) where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.update_use_source/' main.vector2_notembedded [ pass ] 4038 main.vector_innodb [ pass ] 785 main.mysql_upgrade_mysql_json_datatype [ pass ] 3191 main.lowercase_mixed_tmpdir_innodb [ skipped ] Test requires: 'lowercase2' main.lowercase_table2 [ skipped ] Test requires: 'lowercase2' main.lowercase_table4 [ skipped ] Test requires: 'case_insensitive_file_system' main.plugin_auth [ pass ] 4424 main.plugin_innodb [ pass ] 1698 main.xa_prepared_binlog_off [ pass ] 2993 main.temp_table [ pass ] 131 main.stat_tables_par_innodb [ pass ] 4570 ReplayTest: Loading context ReplayTest: Loading context main.statistics [ pass ] 2407 main.statistics_index_crash-7362 [ pass ] 34 main.alter_events [ pass ] 139 main.alter_table [ pass ] 3284 main.alter_table_autoinc-5574 [ pass ] 19 main.alter_table_errors [ pass ] 16 main.alter_table_lock [ pass ] 89 main.alter_table_online 'nobinlog' [ pass ] 149 main.alter_table_trans [ pass ] 38 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.analyze_stmt_orderby [ pass ] 129 main.backup_lock_debug [ pass ] 35 main.backup_log [ pass ] 93 main.bootstrap_innodb [ pass ] 1788 main.cache_innodb [ pass ] 104 main.check_constraint_innodb [ pass ] 26 main.column_compression [ pass ] 558 main.commit [ pass ] 54 main.concurrent_innodb_safelog [ pass ] 9208 main.concurrent_innodb_unsafelog [ pass ] 5185 main.consistent_snapshot [ pass ] 24 main.ctype_filename_innodb [ pass ] 19 main.ctype_sjis_innodb [ pass ] 70 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_uca_innodb [ fail ] Test ended at 2026-04-23 23:06:46 CURRENT_TEST: main.ctype_uca_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_uca_innodb.result 2026-04-02 14:38:09.315657759 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_uca_innodb.reject 2026-04-23 23:06:46.514517775 +0300 @@ -25,7 +25,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -44,13 +46,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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; @@ -94,7 +100,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -117,7 +125,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -146,14 +156,18 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_uca_innodb/' main.ctype_upgrade [ pass ] 1962 main.ctype_utf32_innodb [ pass ] 21 main.ctype_utf8mb3_innodb [ pass ] 23 ReplayTest: Loading context main.ctype_utf8mb4_0900 [ pass ] 149 main.deadlock_innodb [ pass ] 6101 main.debug_sync [ pass ] 70 main.default [ pass ] 411 main.default_innodb [ pass ] 15 main.delete_multi_order_by [ pass ] 45 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.delete_use_source_engines [ fail ] Test ended at 2026-04-23 23:07:00 CURRENT_TEST: main.delete_use_source_engines --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_use_source_engines.result 2026-04-02 14:38:09.333657711 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_use_source_engines.reject 2026-04-23 23:07:00.390089083 +0300 @@ -2443,8 +2443,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -2506,9 +2508,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -3166,8 +3170,8 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range t1_c2 t1_c2 5 NULL # Using index condition -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 # Using index; FirstMatch(t1) +1 PRIMARY a range t1_c2 t1_c2 5 NULL # Using where; Using index; LooseScan +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 # explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra @@ -3211,8 +3215,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -3274,9 +3280,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # Using where; Using index 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -3983,8 +3991,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -4046,9 +4056,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where 2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 # +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -4848,8 +4860,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -4911,9 +4925,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -5524,7 +5540,7 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 -1 PRIMARY a ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join) explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 @@ -5571,8 +5587,8 @@ explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL # Using where; Using filesort -1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 # Using index; FirstMatch(t1) +1 PRIMARY a index t1_c2 t1_c2 10 NULL # Using where; Using index; LooseScan; Using filesort +1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 # explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2; id select_type table type possible_keys key key_len ref rows Extra @@ -5616,8 +5632,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -5679,9 +5697,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # Using where; Using index 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -6388,8 +6408,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -6451,9 +6473,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where 2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 # +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -7244,8 +7268,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -7307,9 +7333,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -7466,10 +7494,16 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where 1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where 1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1) +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3; affected rows: 8 select * from t1; @@ -7946,11 +7980,15 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where 2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a where a.c1 = t1.c1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where 2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts delete from t1 where t1.c2 in ( select max(a.c2) from v1 a where a.c1 = t1.c1); affected rows: 8 @@ -7995,11 +8033,15 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where 2 DEPENDENT SUBQUERY a ALL t1_c2 NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL t1_c2 NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -8060,9 +8102,12 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const 2 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 2 Using where 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.t1_c2 doesn't exist in list of range contexts delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); @@ -8757,8 +8802,10 @@ explain delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c1 in (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5; affected rows: 0 @@ -8820,9 +8867,11 @@ and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where 2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3) and c1 = 2 and exists (select 'X' from v1 a where a.c1 = v1.c1); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete_use_source_engines/' ReplayTest: Loading context ReplayTest: Loading context main.derived_cond_pushdown_innodb [ pass ] 54 main.drop [ pass ] 72 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.endspace [ pass ] 72 ReplayTest: Loading context main.explain_innodb [ pass ] 30 ReplayTest: Loading context main.explain_json_innodb [ pass ] 30 ReplayTest: Loading context main.ext_key_noPK_6794 [ pass ] 28 main.fast_prefix_index_fetch_innodb [ pass ] 48 main.flush-innodb [ pass ] 151 main.flush-innodb-notembedded [ pass ] 18 main.flush_block_commit [ pass ] 1036 main.flush_read_lock [ pass ] 5442 main.flush_read_lock_kill [ pass ] 137 main.foreign_key [ pass ] 58 main.foreign_key_lowercase0 [ pass ] 26 ReplayTest: Loading context main.func_analyse [ pass ] 79 ReplayTest: Loading context ReplayTest: Loading context 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.func_group_innodb [ fail ] Test ended at 2026-04-23 23:07:12 CURRENT_TEST: main.func_group_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_group_innodb.result 2026-04-02 14:38:09.352657659 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_group_innodb.reject 2026-04-23 23:07:11.811030896 +0300 @@ -262,7 +262,7 @@ explain SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; 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(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu'; MIN(t1.v1) king Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_group_innodb/' ReplayTest: Loading context main.func_json [ pass ] 187 main.func_rollback [ pass ] 73 main.function_defaults_innodb [ pass ] 745 main.get_diagnostics [ pass ] 130 main.gis-alter_table [ pass ] 18 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.greedy_optimizer [ fail ] Test ended at 2026-04-23 23:07:29 CURRENT_TEST: main.greedy_optimizer --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/greedy_optimizer.result 2026-04-17 18:40:40.419797450 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/greedy_optimizer.reject 2026-04-23 23:07:29.075581149 +0300 @@ -127,7 +127,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -139,7 +139,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -151,7 +151,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -163,7 +163,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -175,7 +175,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -187,7 +187,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 set optimizer_prune_level=0; select @@optimizer_prune_level; @@optimizer_prune_level @@ -207,7 +207,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2.998640 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -219,7 +219,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2.998640 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -231,7 +231,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -243,7 +243,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -255,7 +255,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -267,7 +267,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -283,7 +283,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 42.599713 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index @@ -295,7 +295,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 42.599713 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index @@ -307,7 +307,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 14.817907 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index @@ -319,7 +319,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 14.817907 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -331,7 +331,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1.698747 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -343,7 +343,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1.698747 +Last_query_cost 0.024323 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -359,7 +359,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2.998640 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -371,7 +371,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2.998640 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -383,7 +383,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -395,7 +395,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -407,7 +407,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -419,7 +419,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 set optimizer_prune_level=2; select @@optimizer_prune_level; @@optimizer_prune_level @@ -439,7 +439,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -451,7 +451,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -463,7 +463,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -475,7 +475,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -487,7 +487,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -499,7 +499,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -515,7 +515,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 42.599713 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index @@ -527,7 +527,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 42.599713 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index @@ -539,7 +539,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 14.817907 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index @@ -551,7 +551,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 14.817907 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -563,7 +563,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1.698747 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -575,7 +575,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1.698747 +Last_query_cost 0.024323 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -591,7 +591,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -603,7 +603,7 @@ 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 4.284314 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -615,7 +615,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -627,7 +627,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.602062 +Last_query_cost 0.024323 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -639,7 +639,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -651,7 +651,7 @@ 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.621783 +Last_query_cost 0.024323 drop table t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1); @@ -857,7 +857,7 @@ AND t10000.K=t10.K; COUNT(*) 9 -### NOTE: Handler_reads: 31, expected: 30 ### +### NOTE: Handler_reads: 45, expected: 44 ### flush status; EXPLAIN SELECT COUNT(*) FROM t100,t10,t10000 WHERE t100.K=t10.I @@ -897,7 +897,7 @@ AND t10000.K=t10.K; COUNT(*) 9 -### NOTE: Handler_reads: 31, expected: 30 ### +### NOTE: Handler_reads: 45, expected: 44 ### flush status; EXPLAIN SELECT COUNT(*) FROM t10000,t100,t10 WHERE t100.K=t10.I @@ -911,7 +911,7 @@ AND t10000.K=t10.K; COUNT(*) 9 -### NOTE: Handler_reads: 31, expected: 30 ### +### NOTE: Handler_reads: 45, expected: 44 ### ##### ## EQ_REF Should be executed before table scan(ALL) ## - Independent of #records in table being EQ_REF-joined @@ -1179,7 +1179,7 @@ AND t10000.I=t10.I; COUNT(*) 9000 -### NOTE: Handler_reads: 9030, expected: 9045 ### +### NOTE: Handler_reads: 9047, expected: 9062 ### flush status; EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100 WHERE t100.K=t10.I @@ -1193,7 +1193,7 @@ AND t10000.I=t10.I; COUNT(*) 9000 -### NOTE: Handler_reads: 9030, expected: 9045 ### +### NOTE: Handler_reads: 9047, expected: 9062 ### ##### ## EQ_REF & REF join two instances of t10000 with t10: ##### Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.greedy_optimizer/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.group_by_innodb [ pass ] 118 main.ignored_index_innodb [ pass ] 19 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.index_intersect_innodb [ fail ] Test ended at 2026-04-23 23:07:32 CURRENT_TEST: main.index_intersect_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_intersect_innodb.result 2026-04-17 18:40:40.424797759 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_intersect_innodb.reject 2026-04-23 23:07:32.327719095 +0300 @@ -71,22 +71,30 @@ SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1245. SELECT * FROM City USE INDEX () WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -368,17 +376,23 @@ SELECT * FROM City WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Country,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1236. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where +1 SIMPLE City range Population,Country,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1236. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,Country Name,Population # NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE City range Population,Name,Country Population # NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1235. SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -470,28 +484,34 @@ WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1797. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1794. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country Country 7 NULL # Using index condition; Using where +1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1799. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population 4,4 NULL # Using sort_intersect(PRIMARY,Population); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population 4,4 NULL # Using sort_intersect(PRIMARY,Population); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country 4,7 NULL # Using sort_intersect(PRIMARY,Country); Using where SELECT * FROM City USE INDEX () WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; ID Name Country Population @@ -703,33 +723,43 @@ SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1246. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where +1 SIMPLE City range Population,Country,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1236. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE City range Population,Country,Name Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1235. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1794. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Country 4,7 NULL # Using sort_intersect(PRIMARY,Country); Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -858,7 +888,9 @@ SELECT * FROM City WHERE Country LIKE 'M%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL # Using sort_intersect(Population,CountryID); Using where +1 SIMPLE City range Population,CountryID,CountryName Population 4 NULL # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1352. EXPLAIN SELECT * FROM City WHERE Country='USA' AND Population > 1000000; @@ -868,7 +900,9 @@ SELECT * FROM City WHERE Country='USA' AND Population > 1500000 AND Name LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,CountryID,CountryName CountryName,Population 38,4 NULL # Using sort_intersect(CountryName,Population); Using where +1 SIMPLE City ref Population,Name,CountryID,CountryName CountryID 3 const # Using index condition; Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1360. SELECT * FROM City USE INDEX () WHERE Country LIKE 'M%' AND Population > 1000000; ID Name Country Population @@ -940,8 +974,15 @@ WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND Country.Code=City.Country; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,CountryID,CountryName Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Name,CountryID,CountryName Population 4 NULL # Using index condition; Using where 1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country # +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2148. +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City doesn't exist in list of table contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City.Population doesn't exist in list of range contexts +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City.Name doesn't exist in list of range contexts DROP DATABASE world; use test; CREATE TABLE t1 ( @@ -969,7 +1010,9 @@ SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,f4 PRIMARY,f4 4,39 NULL # Using sort_intersect(PRIMARY,f4); Using where +1 SIMPLE t1 range PRIMARY,f4 PRIMARY 4 NULL # Using where +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1037. SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; f1 f4 f5 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.index_intersect_innodb/' main.information_schema-big [ pass ] 5313 main.information_schema-big_embedded [ skipped ] Test requires: embedded server main.information_schema_db [ pass ] 175 main.information_schema_inno [ pass ] 91 main.information_schema_temp_table [ pass ] 175 ReplayTest: Loading context main.innodb_bug878769 [ pass ] 42 main.innodb_group [ pass ] 12 ReplayTest: Loading context main.innodb_icp_debug [ pass ] 119 ReplayTest: Loading context ReplayTest: Loading context 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_mrr_cpk [ pass ] 380 main.innodb_utf8 [ pass ] 16 main.insert_innodb [ pass ] 43 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.join_outer_innodb [ fail ] Test ended at 2026-04-23 23:07:42 CURRENT_TEST: main.join_outer_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer_innodb.result 2026-04-02 14:38:09.386657567 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer_innodb.reject 2026-04-23 23:07:41.832596427 +0300 @@ -10,14 +10,18 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,name name 23 NULL 2 Using where; Using index +1 SIMPLE t1 range PRIMARY,name name 23 NULL 1 Using where; Using index 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using index +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 471. EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%' OR FALSE; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,name name 23 NULL 2 Using where; Using index +1 SIMPLE t1 range PRIMARY,name name 23 NULL 1 Using where; Using index 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using index +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 471. DROP TABLE t1,t2; # # BUG#58456: Assertion 0 in QUICK_INDEX_MERGE_SELECT::need_sorted_output Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_outer_innodb/' main.keyread [ pass ] 30 main.kill [ pass ] 200 main.kill_debug [ pass ] 106 main.leaks [ pass ] 25 main.loaddata_innodb [ pass ] 32 main.lock_kill [ pass ] 42 main.locked_temporary-5955 [ pass ] 4 main.locking_clause [ pass ] 31 main.log_tables_upgrade [ pass ] 1016 main.long_unique_innodb_debug [ pass ] 1151 main.mariadb-dump-debug [ pass ] 103 main.mariadb-import [ pass ] 1575 main.mdev-35046 [ pass ] 1438 main.mdev-35721-ubsan [ pass ] 52 ReplayTest: Loading context main.mdev13607 [ pass ] 197 main.mdev_32854 [ pass ] 1155 ReplayTest: Loading context main.mrr_derived_crash_4610 [ pass ] 39 main.multi_update_innodb [ pass ] 132 main.mysql57nopart [ pass ] 10 main.mysql_tzinfo_to_sql_symlink [ pass ] 253 main.mysql_upgrade_noengine [ pass ] 3078 main.mysql_upgrade_ssl [ pass ] 906 main.mysqldump-order-by-size [ pass ] 68 main.mysqldump-system 'unix' [ pass ] 333 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_index_merge [ pass ] 1346 ReplayTest: Loading context main.opt_hints_subquery_innodb [ pass ] 22 ReplayTest: Loading context main.opt_trace_index_merge_innodb [ fail ] Test ended at 2026-04-23 23:08:02 CURRENT_TEST: main.opt_trace_index_merge_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_index_merge_innodb.result 2026-04-17 18:40:40.459799922 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_index_merge_innodb.reject 2026-04-23 23:08:01.667379468 +0300 @@ -25,14 +25,14 @@ 1 SIMPLE t1 ref PRIMARY,key1 key1 4 const 1 Using index condition select * from information_schema.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where pk1 != 0 and key1 = 1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.pk1 AS pk1,t1.pk2 AS pk2,t1.key1 AS key1,t1.key2 AS key2 from t1 where t1.pk1 <> 0 and t1.key1 = 1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -42,158 +42,21 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.pk1 <> 0 and t1.key1 = 1", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.pk1 <> 0 and multiple equal(1, t1.key1)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.pk1 <> 0 and multiple equal(1, t1.key1)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.pk1 <> 0 and multiple equal(1, t1.key1)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t1", - "index": "key1", - "field": "key1", - "equals": "1", - "null_rejecting": false - } - ] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 1000, - "cost": 0.1764192 - }, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": ["pk1", "pk2"] - }, - { - "index": "key1", - "usable": true, - "key_parts": ["key1"] - }, - { - "index": "key2", - "usable": false, - "cause": "not applicable" - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": ["(pk1) < (0)", "(0) < (pk1)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1000, - "cost": 0.16706826, - "chosen": true - }, - { - "index": "key1", - "ranges": ["(1) <= (key1) <= (1)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.00424968, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "intersecting_indexes": [ - { - "index": "key1", - "index_scan_cost": 0.001661605, - "cumulated_index_scan_cost": 0.001661605, - "disk_sweep_cost": 0.00171364, - "cumulative_total_cost": 0.003375245, - "usable": true, - "matching_rows_now": 1, - "intersect_covering_with_this_index": false, - "chosen": true - } - ], - "clustered_pk": { - "index_scan_cost": 0.000002653, - "cumulated_index_scan_cost": 0.001664258, - "disk_sweep_cost": 0.00171364, - "clustered_pk_added_to_intersect": false, - "cause": "cost" - }, - "chosen": false, - "cause": "too few indexes to merge" - } - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "key1", - "rows": 1, - "ranges": ["(1) <= (key1) <= (1)"] - }, - "rows_for_plan": 1, - "cost_for_plan": 0.00424968, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "key1", - "build_cost": 0.001763258, - "rows": 1 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "key1", - "selectivity_from_index": 0.001 - }, - { - "index_name": "PRIMARY", - "selectivity_from_index": 1 - } - ], - "selectivity_for_columns": [], - "cond_selectivity": 0.001 } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -207,31 +70,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "ref", - "index": "key1", - "used_range_estimates": true, - "rows": 1, - "cost": 0.00345856, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" } ], "chosen_access_method": { - "type": "ref", - "index": "key1", - "rows_read": 1, - "rows_out": 1, - "cost": 0.00345856, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -240,41 +98,30 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 1, - "cost_for_plan": 0.00345856 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 1, - "cost": 0.00345856 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.key1 = 1 and t1.pk1 <> 0" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.pk1 <> 0" + "table": "optimizer_context", + "attached_condition": null } ] } }, { - "make_join_readinfo": [ - { - "table": "t1", - "index_condition": "t1.pk1 <> 0" - } - ] + "make_join_readinfo": [] } ] } Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_trace_index_merge_innodb/' main.parser_bug21114_innodb [ pass ] 1791 main.percona_nonflushing_analyze_debug [ pass ] 24 main.progress_976225 [ pass ] 23 main.ps_innodb [ pass ] 30 main.ps_missed_cmds [ pass ] 56 main.ps_missed_cmds_bin_prot [ skipped ] Need ps-protocol main.ps_missed_cmds_bin_prot_not_embedded [ skipped ] Need ps-protocol main.ps_missed_cmds_not_embedded [ pass ] 12 main.ps_qc_innodb [ pass ] 552 main.query_cache_innodb [ pass ] 78 main.read_only_innodb [ pass ] 66 main.reopen_temp_table [ pass ] 55 ReplayTest: Loading context main.rowid_order_innodb [ pass ] 52 main.servers [ pass ] 66 main.show_analyze [ pass ] 1154 main.show_analyze_json [ pass ] 1254 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain FORMAT=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 ReplayTest: Failed query was: explain format=JSON for connection 76 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain_json [ fail ] Test ended at 2026-04-23 23:08:12 CURRENT_TEST: main.show_explain_json --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain_json.result 2026-04-02 14:38:09.459657369 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain_json.reject 2026-04-23 23:08:12.278282905 +0300 @@ -76,64 +76,14 @@ select max(c) from t1 where a < 10; connection default; explain FORMAT=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "range", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t1.a < 10" - } - } - ] - } -} -Warnings: -Note 1003 select max(c) from t1 where a < 10 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 connection con1; max(c) 9 select max(c) from t1 where a < 10; connection default; explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "range", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t1.a < 10" - } - } - ] - } -} -Warnings: -Note 1003 select max(c) from t1 where a < 10 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 connection con1; max(c) 9 @@ -177,33 +127,7 @@ explain select max(c) from t1 where a < 10; connection default; explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "range", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t1.a < 10", - "mrr_type": "Rowid-ordered scan" - } - } - ] - } -} -Warnings: -Note 1003 explain select max(c) from t1 where a < 10 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 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 @@ -668,79 +592,9 @@ update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "update": 1, - "table_name": "t2", - "access_type": "ALL", - "rows": 2, - "attached_condition": "(subquery#2) > 3" - }, - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - ] - } -} -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "update": 1, - "table_name": "t2", - "access_type": "ALL", - "rows": 2, - "attached_condition": "(subquery#2) > 3" - }, - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - ] - } -} -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -838,79 +692,9 @@ delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "delete": 1, - "table_name": "t2", - "access_type": "ALL", - "rows": 2, - "attached_condition": "(subquery#2) > 3" - }, - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - ] - } -} -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "delete": 1, - "table_name": "t2", - "access_type": "ALL", - "rows": 2, - "attached_condition": "(subquery#2) > 3" - }, - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - ] - } -} -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -1073,140 +857,11 @@ select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; connection default; explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ], - "subqueries": [ - { - "subquery_cache": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - } - ] - } -} -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ], - "subqueries": [ - { - "subquery_cache": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - } - ] - } -} -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 explain format=JSON for connection $thr2; -SHOW EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ], - "subqueries": [ - { - "subquery_cache": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a + t0.a < 3" - } - } - ] - } - } - } - ] - } -} -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 +ReplayTest: Direct EXPLAIN failed on replay server: 1094 Unknown thread id: 76 connection con1; a SUBQ 0 0 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.show_explain_json/' main.show_explain_non_select [ pass ] 134 main.simultaneous_assignment [ pass ] 49 main.single_delete_update_innodb [ pass ] 23 main.sp-group [ pass ] 37 main.sp-innodb [ pass ] 4063 main.ssl_and_innodb [ pass ] 16 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_disabled [ pass ] 3380 main.statistics_upgrade_not_done [ pass ] 2239 main.strict_autoinc_2innodb [ pass ] 16 main.subselect-crash_15755 [ pass ] 69 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect2.test" ReplayTest: At line 194 ReplayTest: Loading context ReplayTest: Query error: Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect2.test" ReplayTest: At line 198 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect2 [ fail ] Test ended at 2026-04-23 23:08:25 CURRENT_TEST: main.subselect2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect2.result 2026-04-02 14:38:09.479657315 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect2.reject 2026-04-23 23:08:25.259181272 +0300 @@ -160,19 +160,11 @@ SET optimizer_switch='materialization=on,in_to_exists=on'; EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index -1 PRIMARY t3 ref b b 5 test.t2.a 1 Using index -2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; pk a b 0 4 4 EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index -1 PRIMARY t3 ref b b 5 test.t2.a 1 Using index -2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; pk a b 0 4 4 @@ -337,12 +329,10 @@ select * from t1, t2 left join t3 on ( t2.a = t3.a ) where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ref idx idx 6 func 1 100.00 Using where; Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`a` = `test`.`t1`.`a`) where `test`.`t1`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`) and `test`.`t2`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(multiple equal(`test`.`t1`.`a`, `test`.`t2`.`a`, `test`.`t3`.`a`)) where 0 select * from t1, t2 left join t3 on ( t2.a = t3.a ) where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 ); a a a Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect2/' main.subselect_nulls_innodb [ pass ] 21 main.system_mysql_db_fix40123 [ pass ] 426 main.system_mysql_db_fix50030 [ pass ] 460 main.system_mysql_db_fix50117 [ pass ] 478 main.system_mysql_db_fix50568 [ pass ] 464 main.tablelock [ pass ] 36 main.tmp_table_error [ pass ] 131 main.transaction_timeout [ pass ] 8038 main.trigger-trans [ pass ] 2088 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_bit_innodb [ pass ] 121 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_blob [ pass ] 236 main.type_num_innodb [ pass ] 50 main.type_temporal_innodb [ pass ] 44 main.type_time_hires [ pass ] 65 main.type_timestamp_hires [ pass ] 87 main.union_innodb [ pass ] 24 main.unique [ pass ] 25 main.unsafe_binlog_innodb [ pass ] 2147 ReplayTest: Loading context ReplayTest: Loading context main.update_innodb [ pass ] 2639 main.vector_symlink [ pass ] 31 main.warnings_debug [ pass ] 15 main.xa [ pass ] 7338 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.xtradb_mrr [ pass ] 790 main.plugin_loaderr [ pass ] 1433 main.mysql_upgrade-28915 [ pass ] 2021 main.alter_table_combinations 'innodb' [ pass ] 102 main.myisam-blob [ pass ] 381 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.key_cache [ pass ] 270 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_pkeycache.test at line 9: ReplayTest: At line 1498 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'b' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_pkeycache.test at line 9: ReplayTest: At line 3924 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.select_pkeycache 'nm' [ fail ] Test ended at 2026-04-23 23:09:08 CURRENT_TEST: main.select_pkeycache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_pkeycache.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_pkeycache.reject 2026-04-23 23:09:08.566852236 +0300 @@ -657,9 +657,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 @@ -2046,7 +2043,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 @@ -2809,20 +2806,20 @@ INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); explain select max(key1) from t1 where key1 <= 0.6158; 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 max(key2) from t2 where key2 <= 1.6158; 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(key1) from t1 where key1 >= 0.3762; 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(key2) from t2 where key2 >= 1.3762; 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 max(key1), min(key2) from t1, t2 where key1 <= 0.6158 and key2 >= 1.3762; 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 max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range key1 key1 5 NULL 3 Using where; Using index @@ -3908,7 +3905,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -3917,7 +3916,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4001,7 +4002,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -4010,7 +4013,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4150,7 +4155,6 @@ Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4627,12 +4631,6 @@ JOIN t1 y ON x.a=y.a JOIN t1 z ON y.a=z.a WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE x system NULL NULL NULL NULL 1 100.00 -1 SIMPLE y system NULL NULL NULL NULL 1 100.00 -1 SIMPLE z system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1 DROP TABLE t1; # # Bug #49897: crash in ptr_compare when char(0) NOT NULL @@ -4906,10 +4904,7 @@ @cnt 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) +ReplayTest: Query error: FUNCTION test.f1 does not exist DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5703,7 +5698,7 @@ SELECT * FROM t1 WHERE a = 1 AND (3 = 0 OR (SELECT a = 1 OR (SELECT 3 WHERE a = a) = 3)); 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; Using temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.select_pkeycache-nm/' main.locale [ pass ] 72 main.ctype_cp932_binlog_stm [ pass ] 901 main.partition_binlog [ pass ] 117 main.alter_table-big [ pass ] 199 main.create-big [ pass ] 231 main.mysqlbinlog_row_big [ pass ] 854 main.compound [ pass ] 159 main.create_drop_binlog [ pass ] 95 main.create_drop_function [ pass ] 15 main.ctype_gbk_binlog [ pass ] 55 main.flush_and_binlog [ pass ] 5037 main.mdev-31636 [ pass ] 9 main.multi_update_binlog [ pass ] 140 main.mysql_binary_mode [ pass ] 206 main.mysql_binary_zero_insert [ pass ] 268 main.mysql_upgrade_view [ pass ] 2910 main.mysqlbinlog_raw_mode [ pass ] 166 main.mysqldump_restore [ pass ] 686 main.mysqltest [ pass ] 10491 main.ps_change_master [ pass ] 16 main.trigger_wl3253 [ pass ] 210 main.user_var-binlog [ pass ] 81 main.system_mysql_db_error_log [ pass ] 56 main.show_check [ pass ] 223 ReplayTest: Loading context ReplayTest: Loading context main.status [ fail ] Test ended at 2026-04-23 23:09:48 CURRENT_TEST: main.status --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/status.result 2026-04-17 18:40:40.504802702 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/status.reject 2026-04-23 23:09:48.159860544 +0300 @@ -140,7 +140,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 0.010348 +Last_query_cost 0.024323 SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a; a 1 @@ -155,7 +155,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 0.010348 +Last_query_cost 0.024323 SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1; a IN (SELECT a FROM t1) 1 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.status/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.union [ fail ] Test ended at 2026-04-23 23:09:49 CURRENT_TEST: main.union --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/union.result 2026-04-17 18:40:40.524803938 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/union.reject 2026-04-23 23:09:49.548858918 +0300 @@ -2036,7 +2036,7 @@ insert t1 values (1),(2),(3),(1); explain select 1 from dual where exists (select max(a) from t1 group by a union select a+2 from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using temporary 3 UNION t1 ALL NULL NULL NULL NULL 4 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.union/' main.multi_statement [ pass ] 37 main.log_slow_filter [ pass ] 33 ReplayTest: Loading context ReplayTest: Loading context main.explain_slowquerylog [ pass ] 63 main.analyze_stmt_slow_query_log [ pass ] 43 main.partition_blackhole [ pass ] 32 main.blackhole [ pass ] 39 main.mysqldump-compat [ pass ] 175 ReplayTest: Loading context ReplayTest: Loading context main.func_encrypt [ pass ] 45 main.ssl_7937 'nossl' [ pass ] 77 main.ssl_autoverify 'auto,unix' [ pass ] 802 main.cli_options_force_protocol_win [ skipped ] Need windows main.mysqldump-win [ skipped ] Need windows main.ssl_autoverify 'pem,unix' [ pass ] 776 main.auth_named_pipe [ skipped ] Need windows main.named_pipe [ skipped ] Need windows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition [ pass ] 1997 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.selectivity [ fail ] Test ended at 2026-04-23 23:10:07 CURRENT_TEST: main.selectivity --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity.result 2026-04-02 14:38:09.453657386 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity.reject 2026-04-23 23:10:07.289846341 +0300 @@ -74,17 +74,17 @@ 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 +1 PRIMARY nation ref PRIMARY,i_n_regionkey i_n_regionkey 5 dbt3_s001.region.r_regionkey 5 100.00 +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; Using join buffer (flat, BNL join) +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 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` +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`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_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 @@ -597,8 +597,8 @@ 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.11Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 10.71 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 4.67Using 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 15.14 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 @@ -652,8 +652,8 @@ 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.40Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 25.00 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 2.00Using 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 15.14 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 @@ -707,8 +707,8 @@ 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.40Using where; FirstMatch(supplier) +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 25.00 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 2.00Using 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 15.14 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 @@ -835,7 +835,7 @@ 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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 50.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; @@ -2129,14 +2129,14 @@ 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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 100.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 +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 100.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; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.stat_tables [ fail ] Test ended at 2026-04-23 23:10:09 CURRENT_TEST: main.stat_tables --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables.result 2026-04-02 14:38:09.473657332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables.reject 2026-04-23 23:10:09.592273260 +0300 @@ -251,12 +251,14 @@ 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 ALL PRIMARY,i_s_nationkey NULL NULL NULL 10 Using where; Using temporary; Using filesort +1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 Using where; Using temporary; Using filesort +1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 +1 SIMPLE supplier range PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 1 Using index condition; Using where; Using join buffer (flat, BNL join) 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 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.part.p_partkey,dbt3_s001.partsupp.ps_suppkey 8 1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.supplier.i_s_nationkey doesn't exist in list of range contexts 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, @@ -269,14 +271,15 @@ 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 ALL PRIMARY,i_s_nationkey NULL NULL NULL 10 100.00 Using where; Using temporary; Using filesort +1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 100.00 Using where; Using temporary; Using filesort +1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 +1 SIMPLE supplier range PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 1 100.00 Using index condition; Using where; Using join buffer (flat, BNL join) 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 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.part.p_partkey,dbt3_s001.partsupp.ps_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 +Warning 4254 Failed to match the stats from replay context with the optimizer stats: dbt3_s001.supplier.i_s_nationkey doesn't exist in list of range contexts +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`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`part`.`p_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, @@ -405,7 +408,7 @@ 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 +1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.stat_tables/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.limit_rows_examined [ fail ] Test ended at 2026-04-23 23:10:10 CURRENT_TEST: main.limit_rows_examined --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/limit_rows_examined.result 2026-04-17 18:40:40.433798315 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/limit_rows_examined.reject 2026-04-23 23:10:10.320845631 +0300 @@ -581,7 +581,7 @@ explain select max(c1) from t3i LIMIT ROWS EXAMINED 0; 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 max(c1) from t3i LIMIT ROWS EXAMINED 0; max(c1) bb @@ -677,8 +677,7 @@ WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d) HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) SELECT DISTINCT a AS field1 FROM t1, t2 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.limit_rows_examined/' ***Warnings generated in error logs during shutdown after running tests: main.limit_rows_examined 2026-04-23 23:10:10 4 [Warning] Sort aborted, host: localhost, user: root, thread: 4, query: select c1, c2 from t3 order by c2, c1 LIMIT ROWS EXAMINED 2 2026-04-23 23:10:10 4 [Warning] Sort aborted, host: localhost, user: root, thread: 4, query: select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2 ReplayTest: Loading context ReplayTest: Loading context main.opt_context_store_ddls [ fail ] Test ended at 2026-04-23 23:10:11 CURRENT_TEST: main.opt_context_store_ddls --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_store_ddls.result 2026-04-23 22:43:18.851496758 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_store_ddls.reject 2026-04-23 23:10:10.904845537 +0300 @@ -508,25 +508,9 @@ set @fn= (select JSON_DETAILED(JSON_EXTRACT(@opt_context, '$**.name'))); select name from json_table(@fn, '$[*]' columns(name text path '$')) as jt; name -db1.t2 -db1.t1 select @ddls; @ddls -CREATE TABLE `t2` ( - `a` int(11) NOT NULL, - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - -REPLACE INTO db1.t2(a, b) VALUES (1, 1); - -DROP TABLE IF EXISTS db1.t1; -CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - - +NULL drop table t1; drop table t2; # @@ -591,20 +575,9 @@ set @fn= (select JSON_DETAILED(JSON_EXTRACT(@opt_context, '$**.name'))); select name from json_table(@fn, '$[*]' columns(name text path '$')) as jt; name -db1.t1 select @ddls; @ddls -CREATE TABLE `t1` ( - `pk` int(11) NOT NULL, - `a` int(11) DEFAULT NULL, - PRIMARY KEY (`pk`), - KEY `a` (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci - PARTITION BY RANGE (`pk`) -(PARTITION `p0` VALUES LESS THAN (10) ENGINE = MyISAM, - PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM); - - +NULL drop table t1; # # test with insert delayed @@ -672,24 +645,9 @@ set @fn= (select JSON_DETAILED(JSON_EXTRACT(@opt_context, '$**.name'))); select name from json_table(@fn, '$[*]' columns(name text path '$')) as jt; name -db1.t2 -db1.t1 select @ddls; @ddls -CREATE TABLE `t2` ( - `id` int(11) DEFAULT NULL, - `address` varchar(10) DEFAULT NULL, - KEY `fk_id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - -DROP TABLE IF EXISTS db1.t1; -CREATE TABLE `t1` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(10) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - - +NULL drop table t1; drop table t2; # @@ -714,21 +672,9 @@ set @fn= (select JSON_DETAILED(JSON_EXTRACT(@opt_context, '$**.name'))); select name from json_table(@fn, '$[*]' columns(name text path '$')) as jt; name -db1.t2 -db1.t1 select @ddls; @ddls -CREATE TABLE `t2` ( - `id2` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - -DROP TABLE IF EXISTS db1.t1; -CREATE TABLE `t1` ( - `id1` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`id1`) -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - - +NULL # rerun the same delete query # Now, trace result should have the ddls for all 2 tables, # even though no data is deleted @@ -746,20 +692,8 @@ set @fn= (select JSON_DETAILED(JSON_EXTRACT(@opt_context, '$**.name'))); select name from json_table(@fn, '$[*]' columns(name text path '$')) as jt; name -db1.t2 -db1.t1 select @ddls; @ddls -CREATE TABLE `t2` ( - `id2` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - -DROP TABLE IF EXISTS db1.t1; -CREATE TABLE `t1` ( - `id1` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`id1`) -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; - - +NULL drop table t1, t2; drop database db1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_context_store_ddls/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_trace [ fail ] Test ended at 2026-04-23 23:10:12 CURRENT_TEST: main.opt_trace --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace.result 2026-04-17 18:40:40.459799922 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace.reject 2026-04-23 23:10:12.723845349 +0300 @@ -666,31 +666,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 10 QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from v2 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "view": { - "table": "v2", - "select_id": 2, - "algorithm": "merged" - } - }, - { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "expanded_query": "/* select#2 */ select t2.a AS a from t2" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select v2.a AS a from v2" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -702,11 +685,11 @@ { "rows_estimation": [ { - "table": "t2", + "table": "optimizer_context", "table_scan": { - "rows": 10, - "read_cost": 0.01127965, - "read_and_compare_cost": 0.01159965 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -714,7 +697,7 @@ { "table_dependencies": [ { - "table": "t2", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -728,26 +711,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t2", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 10, - "rows_after_filter": 10, - "rows_out": 10, - "cost": 0.01159965, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 10, - "rows_out": 10, - "cost": 0.01159965, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -756,23 +739,23 @@ }, { "plan_prefix": "", - "table": "t2", - "rows_for_plan": 10, - "cost_for_plan": 0.01159965 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t2"], - "rows": 10, - "cost": 0.01159965 + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t2", + "table": "optimizer_context", "attached_condition": null } ] @@ -792,31 +775,14 @@ 1 PRIMARY ALL NULL NULL NULL NULL 4 2 DERIVED t1 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from v1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "view": { - "table": "v1", - "select_id": 2, - "algorithm": "materialized" - } - }, - { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "expanded_query": "/* select#2 */ select t1.a AS a from t1 group by t1.b" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select v1.a AS a from v1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -826,130 +792,13 @@ "select_id": 1, "steps": [ { - "join_optimization": { - "select_id": 2, - "steps": [ - { - "rows_estimation": [ - { - "table": "t1", - "table_scan": { - "rows": 10, - "read_cost": 0.01127965, - "read_and_compare_cost": 0.01159965 - } - } - ] - }, - { - "table_dependencies": [ - { - "table": "t1", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [] - } - ] - }, - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 10, - "rows_after_filter": 10, - "rows_out": 10, - "cost": 0.01159965, - "index_only": false, - "chosen": true, - "use_tmp_table": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 10, - "rows_out": 10, - "cost": 0.01159965, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t1", - "rows_for_plan": 10, - "cost_for_plan": 0.01159965, - "cost_for_sorting": 0.006368384 - } - ] - }, - { - "materialized_output_cardinality": { - "join_output_cardinality": 10, - "estimation": [ - { - "table": "t1", - "steps": [ - { - "column": "b", - "cardinality": 4 - } - ], - "cardinality": 4 - } - ], - "post_group_cardinality": 4 - } - }, - { - "check_split_materialized": { - "not_applicable": "group list has no candidates" - } - }, - { - "best_join_order": ["t1"], - "rows": 10, - "cost": 0.017968034 - }, - { - "attaching_conditions_to_tables": { - "attached_conditions_computation": [], - "attached_conditions_summary": [ - { - "table": "t1", - "attached_condition": null - } - ] - } - }, - { - "make_join_readinfo": [] - }, - { - "test_if_skip_sort_order": [] - } - ] - } - }, - { "rows_estimation": [ { - "table": "", + "table": "optimizer_context", "table_scan": { - "rows": 4, - "read_cost": 0.010041402, - "read_and_compare_cost": 0.010178738 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -957,7 +806,7 @@ { "table_dependencies": [ { - "table": "", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -971,26 +820,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 4, - "rows_after_filter": 4, - "rows_out": 4, - "cost": 0.010178738, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 4, - "rows_out": 4, - "cost": 0.010178738, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -999,23 +848,23 @@ }, { "plan_prefix": "", - "table": "", - "rows_for_plan": 4, - "cost_for_plan": 0.010178738 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": [""], - "rows": 4, - "cost": 0.010178738 + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "", + "table": "optimizer_context", "attached_condition": null } ] @@ -1054,14 +903,14 @@ 1 SIMPLE t2 ref a a 5 test.t1.b 1 Using where select * from information_schema.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a,t1.b AS b,t1.c AS c,t2.a AS a,t2.b AS b,t2.c AS c from t1 join t2 where t1.a = t2.b + 2 and t2.a = t1.b" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -1071,59 +920,13 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a = t2.b + 2 and t2.a = t1.b", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.a = t2.b + 2 and multiple equal(t2.a, t1.b)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.a = t2.b + 2 and multiple equal(t2.a, t1.b)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.a = t2.b + 2 and multiple equal(t2.a, t1.b)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t1", - "index": "a", - "field": "a", - "equals": "t2.b + 2", - "null_rejecting": true - }, - { - "table": "t2", - "index": "a", - "field": "a", - "equals": "t1.b", - "null_rejecting": true - } - ] - }, - { "rows_estimation": [ { - "table": "t1", - "table_scan": { - "rows": 100, - "read_cost": 0.0224761, - "read_and_compare_cost": 0.0256761 - } - }, - { - "table": "t2", + "table": "optimizer_context", "table_scan": { "rows": 100, - "read_cost": 0.0224761, - "read_and_compare_cost": 0.0256761 + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -1131,16 +934,10 @@ { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t2", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] } ] }, @@ -1151,7 +948,7 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, @@ -1161,7 +958,7 @@ "rows": 100, "rows_after_filter": 100, "rows_out": 100, - "cost": 0.0256761, + "cost": 0.0243234, "index_only": false, "chosen": true } @@ -1170,33 +967,7 @@ "type": "scan", "rows_read": 100, "rows_out": 100, - "cost": 0.0256761, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 100, - "rows_after_filter": 100, - "rows_out": 100, - "cost": 0.0256761, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 100, - "rows_out": 100, - "cost": 0.0256761, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -1205,143 +976,24 @@ }, { "plan_prefix": "", - "table": "t1", + "table": "optimizer_context", "rows_for_plan": 100, - "cost_for_plan": 0.0256761, - "rest_of_plan": [ - { - "plan_prefix": "t1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 100 - }, - "considered_access_paths": [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not available", - "rows": 1, - "cost": 0.1821659, - "chosen": true - }, - { - "access_type": "scan_with_join_cache", - "rows": 100, - "rows_after_filter": 100, - "rows_out": 1, - "cost": 0.9604227, - "cost_without_join_buffer": 2.56761, - "index_only": false, - "chosen": false - } - ], - "chosen_access_method": { - "type": "ref", - "index": "a", - "rows_read": 1, - "rows_out": 1, - "cost": 0.1821659, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t2", - "rows_for_plan": 100, - "cost_for_plan": 0.207842 - } - ] - }, - { - "plan_prefix": "", - "table": "t2", - "rows_for_plan": 100, - "cost_for_plan": 0.0256761, - "rest_of_plan": [ - { - "plan_prefix": "t2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 100 - }, - "considered_access_paths": [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not available", - "rows": 1, - "cost": 0.1821659, - "chosen": true - }, - { - "access_type": "scan_with_join_cache", - "rows": 100, - "rows_after_filter": 100, - "rows_out": 1, - "cost": 0.9604227, - "cost_without_join_buffer": 2.56761, - "index_only": false, - "chosen": false - } - ], - "chosen_access_method": { - "type": "ref", - "index": "a", - "rows_read": 1, - "rows_out": 1, - "cost": 0.1821659, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t2", - "table": "t1", - "rows_for_plan": 100, - "cost_for_plan": 0.207842, - "pruned_by_cost": true, - "current_cost": 0.207842, - "best_cost": 0.207842 - } - ] + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1", "t2"], + "best_join_order": ["optimizer_context"], "rows": 100, - "cost": 0.207842 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t2.a = t1.b and t1.a = t2.b + 2" - } + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.b is not null" - }, - { - "table": "t2", - "attached_condition": "t1.a = t2.b + 2" + "table": "optimizer_context", + "attached_condition": null } ] } @@ -1369,14 +1021,14 @@ 1 SIMPLE t1 range NULL a 4 NULL 5 Using index for group-by select * from information_schema.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT DISTINCT a FROM t1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select distinct t1.a AS a from t1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -1388,70 +1040,11 @@ { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 65536, - "cost": 10.29477568 - }, - "potential_range_indexes": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not applicable" - }, - { - "index": "a", - "usable": true, - "key_parts": ["a"] - } - ], - "best_covering_index_scan": { - "index": "a", - "cost": 9.118658462, - "chosen": true - }, - "group_index_range": { - "distinct_query": true, - "potential_group_range_indexes": [ - { - "index": "a", - "covering": true, - "rows": 5, - "cost": 0.004191135 - } - ] - }, - "best_group_range_summary": { - "type": "index_group", - "index": "a", - "min_max_arg": null, - "min_aggregate": false, - "max_aggregate": false, - "distinct_aggregate": false, - "rows": 5, - "cost": 0.004191135, - "key_parts_used_for_access": ["a"], - "ranges": [], - "chosen": true - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "a", - "min_max_arg": null, - "min_aggregate": false, - "max_aggregate": false, - "distinct_aggregate": false, - "rows": 5, - "cost": 0.004191135, - "key_parts_used_for_access": ["a"], - "ranges": [] - }, - "rows_for_plan": 5, - "cost_for_plan": 0.004191135, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -1459,7 +1052,7 @@ { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -1473,25 +1066,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "index_merge", - "rows": 5, - "rows_after_filter": 5, - "rows_out": 5, - "cost": 0.004191135, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true } ], "chosen_access_method": { - "type": "index_merge", - "rows_read": 5, - "rows_out": 5, - "cost": 0.004191135, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -1500,23 +1094,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 5, - "cost_for_plan": 0.004191135 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 5, - "cost": 0.004191135 + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -1524,9 +1118,6 @@ }, { "make_join_readinfo": [] - }, - { - "test_if_skip_sort_order": [] } ] } @@ -1798,14 +1389,14 @@ 1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.`id` AS `id`,min(t1.a) AS `MIN(a)`,max(t1.a) AS `MAX(a)` from t1 where t1.a >= 20010104e0 group by t1.`id`" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -1815,97 +1406,13 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a >= 20010104e0", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.a >= 20010104e0" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.a >= 20010104e0" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.a >= 20010104e0" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 16, - "cost": 0.01253808 - }, - "potential_range_indexes": [ - { - "index": "id", - "usable": true, - "key_parts": ["id", "a"] - } - ], - "best_covering_index_scan": { - "index": "id", - "cost": 0.008002862, - "chosen": true - }, - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "potential_group_range_indexes": [ - { - "index": "id", - "covering": true, - "ranges": ["(2001-01-04) <= (a)"], - "rows": 9, - "cost": 0.005620843 - } - ] - }, - "best_group_range_summary": { - "type": "index_group", - "index": "id", - "min_max_arg": "a", - "min_aggregate": true, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 9, - "cost": 0.005620843, - "key_parts_used_for_access": ["id"], - "ranges": ["(2001-01-04) <= (a)"], - "chosen": true - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "id", - "min_max_arg": "a", - "min_aggregate": true, - "max_aggregate": true, - "distinct_aggregate": false, - "rows": 9, - "cost": 0.005620843, - "key_parts_used_for_access": ["id"], - "ranges": ["(2001-01-04) <= (a)"] - }, - "rows_for_plan": 9, - "cost_for_plan": 0.005620843, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -1913,7 +1420,7 @@ { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -1927,26 +1434,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "index_merge", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.005620843, - "chosen": true, - "use_tmp_table": true + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, + "chosen": true } ], "chosen_access_method": { - "type": "index_merge", - "rows_read": 9, - "rows_out": 9, - "cost": 0.005620843, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -1955,52 +1462,30 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 9, - "cost_for_plan": 0.005620843, - "cost_for_sorting": 0.005728198 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 9, - "cost": 0.011349041 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a >= 20010104e0" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.a >= 20010104e0" + "table": "optimizer_context", + "attached_condition": null } ] } }, { "make_join_readinfo": [] - }, - { - "test_if_skip_sort_order": [] - }, - { - "prepare_sum_aggregators": { - "function": "min(t1.a)", - "aggregator_type": "simple" - } - }, - { - "prepare_sum_aggregators": { - "function": "max(t1.a)", - "aggregator_type": "simple" - } } ] } @@ -2012,14 +1497,14 @@ 1 SIMPLE t1 range NULL id 8 NULL 9 Using where; Using index for group-by select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.`id` AS `id`,t1.a AS a from t1 where t1.a = 20010104e0 group by t1.`id`" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -2029,97 +1514,13 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a = 20010104e0", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.a = 20010104e0" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.a = 20010104e0" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.a = 20010104e0" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 16, - "cost": 0.01253808 - }, - "potential_range_indexes": [ - { - "index": "id", - "usable": true, - "key_parts": ["id", "a"] - } - ], - "best_covering_index_scan": { - "index": "id", - "cost": 0.008002862, - "chosen": true - }, - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "potential_group_range_indexes": [ - { - "index": "id", - "covering": true, - "ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"], - "rows": 9, - "cost": 0.005620843 - } - ] - }, - "best_group_range_summary": { - "type": "index_group", - "index": "id", - "min_max_arg": null, - "min_aggregate": false, - "max_aggregate": false, - "distinct_aggregate": false, - "rows": 9, - "cost": 0.005620843, - "key_parts_used_for_access": ["id", "a"], - "ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"], - "chosen": true - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_group", - "index": "id", - "min_max_arg": null, - "min_aggregate": false, - "max_aggregate": false, - "distinct_aggregate": false, - "rows": 9, - "cost": 0.005620843, - "key_parts_used_for_access": ["id", "a"], - "ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"] - }, - "rows_for_plan": 9, - "cost_for_plan": 0.005620843, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -2127,7 +1528,7 @@ { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -2141,26 +1542,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "index_merge", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.005620843, - "chosen": true, - "use_tmp_table": true + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, + "chosen": true } ], "chosen_access_method": { - "type": "index_merge", - "rows_read": 9, - "rows_out": 9, - "cost": 0.005620843, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -2169,40 +1570,30 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 9, - "cost_for_plan": 0.005620843, - "cost_for_sorting": 0.005728198 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 9, - "cost": 0.011349041 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a = 20010104e0" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.a = 20010104e0" + "table": "optimizer_context", + "attached_condition": null } ] } }, { "make_join_readinfo": [] - }, - { - "test_if_skip_sort_order": [] } ] } @@ -2240,14 +1631,14 @@ 1 SIMPLE t1 range a_c,a_b a_c 5 NULL 180 Using where select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where a=1 and b=2 order by c limit 1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.pk AS pk,t1.a AS a,t1.b AS b,t1.c AS c,t1.filler AS filler from t1 where t1.a = 1 and t1.b = 2 order by t1.c limit 1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -2257,164 +1648,21 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a = 1 and t1.b = 2", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "multiple equal(1, t1.a) and multiple equal(2, t1.b)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "multiple equal(1, t1.a) and multiple equal(2, t1.b)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(1, t1.a) and multiple equal(2, t1.b)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t1", - "index": "a_c", - "field": "a", - "equals": "1", - "null_rejecting": true - }, - { - "table": "t1", - "index": "a_b", - "field": "a", - "equals": "1", - "null_rejecting": true - }, - { - "table": "t1", - "index": "a_b", - "field": "b", - "equals": "2", - "null_rejecting": true - } - ] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 1000, - "cost": 0.1731718 - }, - "potential_range_indexes": [ - { - "index": "c", - "usable": false, - "cause": "not applicable" - }, - { - "index": "a_c", - "usable": true, - "key_parts": ["a", "c"] - }, - { - "index": "a_b", - "usable": true, - "key_parts": ["a", "b"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a_c", - "ranges": ["(1) <= (a) <= (1)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 180, - "cost": 0.223437104, - "chosen": false, - "cause": "cost" - }, - { - "index": "a_b", - "ranges": ["(1,2) <= (a,b) <= (1,2)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 41, - "cost": 0.051929313, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a_b", - "rows": 41, - "ranges": ["(1,2) <= (a,b) <= (1,2)"] - }, - "rows_for_plan": 41, - "cost_for_plan": 0.051929313, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "a_b", - "build_cost": 0.005839142, - "rows": 41 - }, - { - "key": "a_c", - "build_cost": 0.023974342, - "rows": 180 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "a_b", - "selectivity_from_index": 0.041 - } - ], - "selectivity_for_columns": [ - { - "column_name": "a", - "ranges": ["1 <= a <= 1"], - "selectivity_from_histogram": 0.181 - }, - { - "column_name": "b", - "ranges": ["2 <= b <= 2"], - "selectivity_from_histogram": 0.021 - } - ], - "cond_selectivity": 0.041 } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -2428,39 +1676,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "ref", - "index": "a_c", - "used_range_estimates": true, - "rows": 180, - "cost": 0.222886962, - "chosen": true - }, - { - "access_type": "ref", - "index": "a_b", - "used_range_estimates": true, - "rows": 41, - "cost": 0.051379171, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" } ], "chosen_access_method": { - "type": "ref", - "index": "a_b", - "rows_read": 41, - "rows_out": 41, - "cost": 0.051379171, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -2469,29 +1704,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 41, - "cost_for_plan": 0.051379171 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 41, - "cost": 0.051379171 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a = 1 and t1.b = 2" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -2499,102 +1728,6 @@ }, { "make_join_readinfo": [] - }, - { - "test_if_skip_sort_order": [ - { - "reconsidering_access_paths_for_index_ordering": { - "clause": "ORDER BY", - "table": "t1", - "rows_estimation": 41, - "filesort_cost": 9.387121e-4, - "read_cost": 0.052317883, - "filesort_type": "priority_queue with addon fields", - "fanout": 1, - "possible_keys": [ - { - "index": "c", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 24, - "range_scan": false, - "scan_cost": 0.030403398, - "chosen": true - }, - { - "index": "a_c", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 4.390243902, - "range_scan": true, - "scan_cost": 0.023390252, - "chosen": true - }, - { - "index": "a_b", - "can_resolve_order": false, - "cause": "not usable index for the query" - } - ] - } - }, - { - "table": "t1", - "range_analysis": { - "potential_range_indexes": [ - { - "index": "c", - "usable": false, - "cause": "not applicable" - }, - { - "index": "a_c", - "usable": true, - "key_parts": ["a", "c"] - }, - { - "index": "a_b", - "usable": false, - "cause": "not applicable" - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a_c", - "ranges": ["(1) <= (a) <= (1)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 180, - "cost": 0.223437104, - "cost_with_limit": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a_c", - "rows": 180, - "ranges": ["(1) <= (a) <= (1)"] - }, - "rows_for_plan": 180, - "cost_for_plan": 0.223437104, - "chosen": true - } - } - } - ] } ] } @@ -2632,15 +1765,14 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain -select t1.a from t1 left join t2 on t1.a=t2.a { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a from (t1 left join t2 on(t1.a = t2.a))" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -2650,57 +1782,24 @@ "select_id": 1, "steps": [ { - "build_equal_items": { - "condition": "ON expr", - "attached_to": "t2", - "resulting_condition": "multiple equal(t1.a, t2.a)" - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t2", - "index": "PRIMARY", - "field": "a", - "equals": "t1.a", - "null_rejecting": true - } - ] - }, - { - "eliminated_tables": ["t2"] - }, - { "rows_estimation": [ { - "table": "t1", + "table": "optimizer_context", "table_scan": { - "rows": 4, - "read_cost": 0.01053322, - "read_and_compare_cost": 0.01066122 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t2", - "rows": 1, - "cost": 1, - "table_type": "const" } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t2", - "row_may_be_null": true, - "map_bit": 1, - "depends_on_map_bits": ["0"] } ] }, @@ -2711,26 +1810,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 4, - "rows_after_filter": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -2739,34 +1838,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 4, - "cost_for_plan": 0.01066122 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t2", "t1"], - "rows": 4, - "cost": 0.01066122 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "condition_on_constant_tables": "1", - "computing_condition": [] - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -2787,14 +1875,14 @@ 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 left join t2 on t2.a=t1.a { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a,t2.a AS a,t2.b AS b from (t1 left join t2 on(t2.a = t1.a))" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -2804,42 +1892,13 @@ "select_id": 1, "steps": [ { - "build_equal_items": { - "condition": "ON expr", - "attached_to": "t2", - "resulting_condition": "multiple equal(t2.a, t1.a)" - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t2", - "index": "PRIMARY", - "field": "a", - "equals": "t1.a", - "null_rejecting": true - } - ] - }, - { - "eliminated_tables": [] - }, - { "rows_estimation": [ { - "table": "t1", - "table_scan": { - "rows": 4, - "read_cost": 0.01053322, - "read_and_compare_cost": 0.01066122 - } - }, - { - "table": "t2", + "table": "optimizer_context", "table_scan": { - "rows": 2, - "read_cost": 0.01028441, - "read_and_compare_cost": 0.01034841 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -2847,16 +1906,10 @@ { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t2", - "row_may_be_null": true, - "map_bit": 1, - "depends_on_map_bits": ["0"] } ] }, @@ -2867,26 +1920,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 4, - "rows_after_filter": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -2895,89 +1948,24 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 4, - "cost_for_plan": 0.01066122, - "rest_of_plan": [ - { - "plan_prefix": "t1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 4 - }, - "considered_access_paths": [ - { - "access_type": "eq_ref", - "index": "PRIMARY", - "rows": 1, - "cost": 0.007120904, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": { - "type": "eq_ref", - "index": "PRIMARY", - "rows_read": 1, - "rows_out": 1, - "cost": 0.007120904, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t2", - "rows_for_plan": 4, - "cost_for_plan": 0.017782124 - } - ] + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1", "t2"], - "rows": 4, - "cost": 0.017782124 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "1" - } - }, - { - "substitute_best_equal": { - "condition": "ON expr", - "attached_to": "t2", - "resulting_condition": "t2.a = t1.a" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "condition_on_constant_tables": "1", - "computing_condition": [] - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null - }, - { - "table": "t2", - "attached_condition": "trigcond(trigcond(t1.a is not null))" } ] } @@ -2996,14 +1984,14 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and t3.a=t1.a { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a from (t1 left join (t2 join t3 on(t2.b = t3.b)) on(t2.a = t1.a and t3.a = t1.a))" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -3013,90 +2001,24 @@ "select_id": 1, "steps": [ { - "build_equal_items": { - "condition": "ON expr", - "attached_to": "t3", - "resulting_condition": "multiple equal(t2.a, t1.a, t3.a) and multiple equal(t2.b, t3.b)" - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t2", - "index": "PRIMARY", - "field": "a", - "equals": "t1.a", - "null_rejecting": true - }, - { - "table": "t2", - "index": "PRIMARY", - "field": "a", - "equals": "t3.a", - "null_rejecting": true - }, - { - "table": "t3", - "index": "PRIMARY", - "field": "a", - "equals": "t2.a", - "null_rejecting": true - }, - { - "table": "t3", - "index": "PRIMARY", - "field": "a", - "equals": "t1.a", - "null_rejecting": true - } - ] - }, - { - "eliminated_tables": ["t3", "t2"] - }, - { "rows_estimation": [ { - "table": "t1", + "table": "optimizer_context", "table_scan": { - "rows": 4, - "read_cost": 0.01053322, - "read_and_compare_cost": 0.01066122 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t2", - "rows": 1, - "cost": 1, - "table_type": "const" - }, - { - "table": "t3", - "rows": 1, - "cost": 1, - "table_type": "const" } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t2", - "row_may_be_null": true, - "map_bit": 1, - "depends_on_map_bits": ["0"] - }, - { - "table": "t3", - "row_may_be_null": true, - "map_bit": 2, - "depends_on_map_bits": ["0"] } ] }, @@ -3107,26 +2029,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 4, - "rows_after_filter": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 4, - "rows_out": 4, - "cost": 0.01066122, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -3135,34 +2057,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 4, - "cost_for_plan": 0.01066122 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t3", "t2", "t1"], - "rows": 4, - "cost": 0.01066122 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "condition_on_constant_tables": "1", - "computing_condition": [] - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -3200,32 +2111,14 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`p` = `test`.`t1`.`a` select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain extended select * from t1 where a in (select p from t2) { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#2 */ select t2.p from t2" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select t1.a AS a,t1.b AS b from t1 where t1.a in (/* select#2 */ select t2.p from t2)" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -3235,186 +2128,54 @@ "select_id": 1, "steps": [ { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "1 and t1.a = t2.p", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "1 and multiple equal(t1.a, t2.p)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "1 and multiple equal(t1.a, t2.p)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(t1.a, t2.p)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", + "table": "optimizer_context", "table_scan": { - "rows": 4, - "read_cost": 0.01053322, - "read_and_compare_cost": 0.01066122 - } - }, - { - "table": "t2", - "table_scan": { - "rows": 101, - "read_cost": 0.022600505, - "read_and_compare_cost": 0.025832505 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] }, { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t2", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] } ] }, { - "execution_plan_for_potential_materialization": { - "steps": [ - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 101, - "rows_after_filter": 101, - "rows_out": 101, - "cost": 0.025832505, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 101, - "rows_out": 101, - "cost": 0.025832505, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t2", - "rows_for_plan": 101, - "cost_for_plan": 0.025832505 - } - ] - } - ] - } - }, - { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 4, - "rows_after_filter": 4, - "rows_out": 4, - "cost": 0.01066122, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 4, - "rows_out": 4, - "cost": 0.01066122, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 101, - "rows_after_filter": 101, - "rows_out": 101, - "cost": 0.025832505, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 101, - "rows_out": 101, - "cost": 0.025832505, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -3423,124 +2184,24 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 4, - "cost_for_plan": 0.01066122, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t2", - "plan_details": { - "record_count": 4 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 101, - "rows_after_filter": 101, - "rows_out": 101, - "cost": 0.063593833, - "cost_without_join_buffer": 0.10333002, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 101, - "rows_out": 101, - "cost": 0.063593833, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t2", - "rows_for_plan": 404, - "cost_for_plan": 0.074255053, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 4, - "cost": 0.074255053 - }, - { - "strategy": "SJ-Materialization", - "rows": 4, - "cost": 0.078768645 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 4, - "tmp_table_rows": 1, - "sj_inner_fanout": 101, - "rows": 4, - "dups_cost": 0.074255053, - "write_cost": 0.02564388, - "full_lookup_cost": 0.06503188, - "total_cost": 0.164930813 - }, - { - "chosen_strategy": "FirstMatch" - } - ], - "sj_rows_out": 1, - "sj_rows_for_plan": 4, - "sj_filtered": 0.99009901 - } - ] - }, - { - "plan_prefix": "", - "table": "t2", - "rows_for_plan": 101, - "cost_for_plan": 0.025832505, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "fix_semijoin_strategies_for_picked_join_order": [ - { - "semi_join_strategy": "FirstMatch", - "join_order": [ - { - "table": "t2" - } - ] + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1", "t2"], - "rows": 4, - "cost": 0.074255053 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t2.p = t1.a" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null - }, - { - "table": "t2", - "attached_condition": "t2.p = t1.a" } ] } @@ -3579,14 +2240,14 @@ 1 SIMPLE t1 ref pk,pk_a,pk_a_b pk_a_b 15 const,const,const 1 Using index select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where pk = 2 and a=5 and b=1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.pk AS pk,t1.a AS a,t1.b AS b from t1 where t1.pk = 2 and t1.a = 5 and t1.b = 1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -3596,233 +2257,21 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.pk = 2 and t1.a = 5 and t1.b = 1", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "multiple equal(2, t1.pk) and multiple equal(5, t1.a) and multiple equal(1, t1.b)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "multiple equal(2, t1.pk) and multiple equal(5, t1.a) and multiple equal(1, t1.b)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(2, t1.pk) and multiple equal(5, t1.a) and multiple equal(1, t1.b)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t1", - "index": "pk", - "field": "pk", - "equals": "2", - "null_rejecting": true - }, - { - "table": "t1", - "index": "pk_a", - "field": "pk", - "equals": "2", - "null_rejecting": true - }, - { - "table": "t1", - "index": "pk_a", - "field": "a", - "equals": "5", - "null_rejecting": true - }, - { - "table": "t1", - "index": "pk_a_b", - "field": "pk", - "equals": "2", - "null_rejecting": true - }, - { - "table": "t1", - "index": "pk_a_b", - "field": "a", - "equals": "5", - "null_rejecting": true - }, - { - "table": "t1", - "index": "pk_a_b", - "field": "b", - "equals": "1", - "null_rejecting": true - } - ] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 10, - "cost": 0.01159965 - }, - "potential_range_indexes": [ - { - "index": "pk", - "usable": true, - "key_parts": ["pk"] - }, - { - "index": "pk_a", - "usable": true, - "key_parts": ["pk", "a"] - }, - { - "index": "pk_a_b", - "usable": true, - "key_parts": ["pk", "a", "b"] - } - ], - "best_covering_index_scan": { - "index": "pk_a_b", - "cost": 0.007173242, - "chosen": true - }, - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "pk", - "ranges": ["(2) <= (pk) <= (2)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - }, - { - "index": "pk_a", - "ranges": ["(2,5) <= (pk,a) <= (2,5)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": false, - "cause": "cost" - }, - { - "index": "pk_a_b", - "ranges": ["(2,5,1) <= (pk,a,b) <= (2,5,1)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 1, - "cost": 0.001478954, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "intersecting_indexes": [ - { - "index": "pk", - "index_scan_cost": 0.000806227, - "cumulated_index_scan_cost": 0.000806227, - "disk_sweep_cost": 0.001143284, - "cumulative_total_cost": 0.001949511, - "usable": true, - "matching_rows_now": 1, - "intersect_covering_with_this_index": false, - "chosen": true - }, - { - "index": "pk_a", - "usable": false, - "cause": "does not reduce cost of intersect" - }, - { - "index": "pk_a_b", - "usable": false, - "cause": "does not reduce cost of intersect" - } - ], - "clustered_pk": { - "clustered_pk_added_to_intersect": false, - "cause": "no clustered pk index" - }, - "chosen": false, - "cause": "cost" - } - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "pk_a_b", - "rows": 1, - "ranges": ["(2,5,1) <= (pk,a,b) <= (2,5,1)"] - }, - "rows_for_plan": 1, - "cost_for_plan": 0.001478954, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "pk", - "build_cost": 0.000899465, - "rows": 1 - }, - { - "key": "pk_a", - "build_cost": 0.000899465, - "rows": 1 - }, - { - "key": "pk_a_b", - "build_cost": 0.000899465, - "rows": 1 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "pk_a_b", - "selectivity_from_index": 0.1 - } - ], - "selectivity_for_columns": [ - { - "column_name": "a", - "ranges": ["5 <= a <= 5"], - "selectivity_from_histogram": 0.1 - }, - { - "column_name": "b", - "ranges": ["1 <= b <= 1"], - "selectivity_from_histogram": 0.1 - } - ], - "cond_selectivity": 0.1 } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -3836,48 +2285,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "ref", - "index": "pk", - "used_range_estimates": true, - "rows": 1, - "cost": 0.002024411, - "chosen": true - }, - { - "access_type": "ref", - "index": "pk_a", - "used_range_estimates": true, - "rows": 1, - "cost": 0.002024411, - "chosen": false, - "cause": "cost" - }, - { - "access_type": "ref", - "index": "pk_a_b", - "used_range_estimates": true, - "rows": 1, - "cost": 0.000928812, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" } ], "chosen_access_method": { - "type": "ref", - "index": "pk_a_b", - "rows_read": 1, - "rows_out": 1, - "cost": 0.000928812, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -3886,29 +2313,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 1, - "cost_for_plan": 0.000928812 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 1, - "cost": 0.000928812 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.pk = 2 and t1.a = 5 and t1.b = 1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -4225,62 +2646,105 @@ 1 SIMPLE t0 range a a 5 NULL 3 Using where select * from information_schema.optimizer_trace; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain delete from t0 where t0.a<3 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "delete from t0 using dual where t0.a < 3" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } }, { - "table": "t0", - "range_analysis": { - "table_scan": { - "rows": 10, - "cost": 0.01159965 - }, - "potential_range_indexes": [ + "join_optimization": { + "select_id": 1, + "steps": [ { - "index": "a", - "usable": true, - "key_parts": ["a"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a", - "ranges": ["(NULL) < (a) < (3)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 3, - "cost": 0.005042291, - "chosen": true + "rows_estimation": [ + { + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 + } + } + ] + }, + { + "table_dependencies": [ + { + "table": "optimizer_context", + "row_may_be_null": false, + "map_bit": 0, + "depends_on_map_bits": [] + } + ] + }, + { + "considered_execution_plans": [ + { + "plan_prefix": "", + "get_costs_for_tables": [ + { + "best_access_path": { + "table": "optimizer_context", + "plan_details": { + "record_count": 1 + }, + "considered_access_paths": [ + { + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, + "uses_join_buffering": false + } + } + } + ] + }, + { + "plan_prefix": "", + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 + } + ] + }, + { + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 + }, + { + "attaching_conditions_to_tables": { + "attached_conditions_computation": [], + "attached_conditions_summary": [ + { + "table": "optimizer_context", + "attached_condition": null + } + ] } - ] - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a", - "rows": 3, - "ranges": ["(NULL) < (a) < (3)"] - }, - "rows_for_plan": 3, - "cost_for_plan": 0.005042291, - "chosen": true - } + }, + { + "make_join_readinfo": [] + } + ] } } ] @@ -4304,14 +2768,14 @@ 1 SIMPLE t1 ref a a 5 test.t0.a 1 select * from information_schema.optimizer_trace; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "delete from t0,t1 using t0 join t1 where t0.a = t1.a and t1.a < 3" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -4321,208 +2785,24 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t0.a = t1.a and t1.a < 3", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.a < 3 and multiple equal(t0.a, t1.a)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.a < 3 and multiple equal(t0.a, t1.a)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.a < 3 and multiple equal(t0.a, t1.a)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t0", - "index": "a", - "field": "a", - "equals": "t1.a", - "null_rejecting": true - }, - { - "table": "t1", - "index": "a", - "field": "a", - "equals": "t0.a", - "null_rejecting": true - } - ] - }, - { "rows_estimation": [ { - "table": "t0", - "range_analysis": { - "table_scan": { - "rows": 10, - "cost": 0.01159965 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": true, - "key_parts": ["a"] - } - ], - "best_covering_index_scan": { - "index": "a", - "cost": 0.007173242, - "chosen": true - }, - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a", - "ranges": ["(NULL) < (a) < (3)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": true, - "rows": 3, - "cost": 0.001755494, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "not single_table" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a", - "rows": 3, - "ranges": ["(NULL) < (a) < (3)"] - }, - "rows_for_plan": 3, - "cost_for_plan": 0.001755494, - "chosen": true - } - } - }, - { - "table": "t0", - "rowid_filters": [ - { - "key": "a", - "build_cost": 0.001129926, - "rows": 3 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "a", - "selectivity_from_index": 0.3 - } - ], - "selectivity_for_columns": [], - "cond_selectivity": 0.3 - }, - { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 10, - "cost": 0.01159965 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": true, - "key_parts": ["a"] - } - ], - "best_covering_index_scan": { - "index": "a", - "cost": 0.007173242, - "chosen": true - }, - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a", - "ranges": ["(NULL) < (a) < (3)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": true, - "rows": 3, - "cost": 0.001755494, - "chosen": true - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "not single_table" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a", - "rows": 3, - "ranges": ["(NULL) < (a) < (3)"] - }, - "rows_for_plan": 3, - "cost_for_plan": 0.001755494, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "a", - "build_cost": 0.001129926, - "rows": 3 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "a", - "selectivity_from_index": 0.3 - } - ], - "selectivity_for_columns": [], - "cond_selectivity": 0.3 } ] }, { "table_dependencies": [ { - "table": "t0", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t1", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] } ] }, @@ -4533,54 +2813,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t0", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "range", - "range_index": "a", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.001755494, - "chosen": true - } - ], - "chosen_access_method": { - "type": "range", - "index": "a", - "rows_read": 3, - "rows_out": 3, - "cost": 0.001755494, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "range", - "range_index": "a", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.001755494, + "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": "a", - "rows_read": 3, - "rows_out": 3, - "cost": 0.001755494, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -4589,133 +2841,23 @@ }, { "plan_prefix": "", - "table": "t0", - "rows_for_plan": 3, - "cost_for_plan": 0.001755494, - "rest_of_plan": [ - { - "plan_prefix": "t0", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not better than ref estimates", - "rows": 1, - "cost": 0.002376836, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": { - "type": "ref", - "index": "a", - "rows_read": 1, - "rows_out": 1, - "cost": 0.002376836, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t0", - "table": "t1", - "rows_for_plan": 3, - "cost_for_plan": 0.00413233 - } - ] - }, - { - "plan_prefix": "", - "table": "t1", - "rows_for_plan": 3, - "cost_for_plan": 0.001755494, - "rest_of_plan": [ - { - "plan_prefix": "t1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t0", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "ref", - "index": "a", - "rec_per_key_stats_missing": true, - "used_range_estimates": false, - "reason": "not better than ref estimates", - "rows": 1.166666667, - "cost": 0.002392836, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": { - "type": "ref", - "index": "a", - "rows_read": 1.166666667, - "rows_out": 1.166666667, - "cost": 0.002392836, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t0", - "rows_for_plan": 3.5, - "cost_for_plan": 0.00414833, - "pruned_by_cost": true, - "current_cost": 0.00414833, - "best_cost": 0.00413233 - } - ] + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t0", "t1"], - "rows": 3, - "cost": 0.00413233 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a = t0.a and t0.a < 3" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t0", - "attached_condition": "t0.a < 3 and t0.a is not null" - }, - { - "table": "t1", + "table": "optimizer_context", "attached_condition": null } ] @@ -4743,31 +2885,14 @@ 2 DERIVED t1 ALL NULL NULL NULL NULL 3 select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from (select rand() from t1)q { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "derived": { - "table": "q", - "select_id": 2, - "algorithm": "materialized" - } - }, - { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "expanded_query": "/* select#2 */ select rand() AS `rand()` from t1" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select q.`rand()` AS `rand()` from (/* select#2 */ select rand() AS `rand()` from t1) q" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -4777,102 +2902,13 @@ "select_id": 1, "steps": [ { - "join_optimization": { - "select_id": 2, - "steps": [ - { - "rows_estimation": [ - { - "table": "t1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - } - ] - }, - { - "table_dependencies": [ - { - "table": "t1", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [] - } - ] - }, - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815 - } - ] - }, - { - "best_join_order": ["t1"], - "rows": 3, - "cost": 0.010504815 - }, - { - "attaching_conditions_to_tables": { - "attached_conditions_computation": [], - "attached_conditions_summary": [ - { - "table": "t1", - "attached_condition": null - } - ] - } - }, - { - "make_join_readinfo": [] - } - ] - } - }, - { "rows_estimation": [ { - "table": "", + "table": "optimizer_context", "table_scan": { - "rows": 3, - "read_cost": 0.010031052, - "read_and_compare_cost": 0.010134054 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] @@ -4880,7 +2916,7 @@ { "table_dependencies": [ { - "table": "", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -4894,26 +2930,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010134054, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010134054, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -4922,23 +2958,23 @@ }, { "plan_prefix": "", - "table": "", - "rows_for_plan": 3, - "cost_for_plan": 0.010134054 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": [""], - "rows": 3, - "cost": 0.010134054 + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "", + "table": "optimizer_context", "attached_condition": null } ] @@ -4971,32 +3007,14 @@ 2 MATERIALIZED t_inner_2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_inner_2) { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#2 */ select t_inner_1.a from t1 t_inner_1 join t1 t_inner_2" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select t1.a AS a from t1 where t1.a in (/* select#2 */ select t_inner_1.a from t1 t_inner_1 join t1 t_inner_2)" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -5006,299 +3024,54 @@ "select_id": 1, "steps": [ { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "1 and t1.a = t_inner_1.a", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "1 and multiple equal(t1.a, t_inner_1.a)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "1 and multiple equal(t1.a, t_inner_1.a)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(t1.a, t_inner_1.a)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", + "table": "optimizer_context", "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_inner_1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_inner_2", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] }, { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t_inner_1", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_2", - "row_may_be_null": false, - "map_bit": 2, - "depends_on_map_bits": [] } ] }, { - "execution_plan_for_potential_materialization": { - "steps": [ - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "rest_of_plan": [ - { - "plan_prefix": "t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022 - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_2", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "pruned_by_heuristic": true - } - ] - } - ] - } - }, - { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -5307,223 +3080,23 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t_inner_1", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t1,t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.015203373, - "cost_without_join_buffer": 0.094543335, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.015203373, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t1,t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 27, - "cost_for_plan": 0.037231395, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 3, - "cost": 0.136562595 - }, - { - "strategy": "SJ-Materialization", - "rows": 3, - "cost": 0.059588485 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 1, - "sj_inner_fanout": 9, - "rows": 3, - "dups_cost": 0.037231395, - "write_cost": 0.02548291, - "full_lookup_cost": 0.00434619, - "total_cost": 0.067060495 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 3, - "sj_filtered": 11.11111111 - } - ] - }, - { - "plan_prefix": "t1", - "table": "t_inner_2", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_2", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "fix_semijoin_strategies_for_picked_join_order": [ - { - "semi_join_strategy": "SJ-Materialization", - "join_order": [ - { - "table": "t_inner_1" - }, - { - "table": "t_inner_2" - } - ] + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1", ""], - "rows": 3, - "cost": 0.059588485 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "condition_on_constant_tables": "1", - "computing_condition": [] - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": null - }, - { - "table": "t_inner_1", - "attached_condition": null - }, - { - "table": "t_inner_2", - "attached_condition": null - }, - { - "table": "", + "table": "optimizer_context", "attached_condition": null } ] @@ -5550,51 +3123,14 @@ 1 PRIMARY t_inner_3 ALL NULL NULL NULL NULL 9 Using where; End temporary; Using join buffer (incremental, BNL join) select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_inner_1.a from t2 t_inner_2, t1 t_inner_1) and -t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1" - } - ] - } - }, - { - "join_preparation": { - "select_id": 3, - "steps": [ - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select t_outer_1.a AS a,t_outer_2.a AS a from t1 t_outer_1 join t2 t_outer_2 where t_outer_1.a in (/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1) and t_outer_2.a in (/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4)" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -5604,326 +3140,54 @@ "select_id": 1, "steps": [ { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "1 and 1 and t_outer_1.a = t_inner_1.a and t_outer_2.a = t_inner_3.a", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "1 and 1 and multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "1 and 1 and multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t_outer_1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_outer_2", + "table": "optimizer_context", "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_2", - "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_inner_3", - "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_4", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] }, { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { "table_dependencies": [ { - "table": "t_outer_1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t_outer_2", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_2", - "row_may_be_null": false, - "map_bit": 2, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_1", - "row_may_be_null": false, - "map_bit": 3, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_3", - "row_may_be_null": false, - "map_bit": 4, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_4", - "row_may_be_null": false, - "map_bit": 5, - "depends_on_map_bits": [] } ] }, { - "execution_plan_for_potential_materialization": { - "steps": [] - } - }, - { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { - "table": "t_outer_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -5932,2000 +3196,24 @@ }, { "plan_prefix": "", - "table": "t_outer_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_outer_2", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.050443503, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.050443503, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.024600489, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.024600489, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.024600489, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.024600489, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.050443503, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.050443503, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_1", - "rows_for_plan": 81, - "cost_for_plan": 0.049238529, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.067582275, - "cost_without_join_buffer": 0.850890015, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.067582275, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 729, - "cost_for_plan": 0.222053862, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.23517089 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.222053862, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.368747182 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.034460781, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.034460781, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.080024379, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.080024379, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.403207963, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.664765924, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.579280032 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.664765924, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.811459244 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.448771561, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_4", - "rows_for_plan": 243, - "cost_for_plan": 0.116820804, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4", - "table": "t_inner_2", - "rows_for_plan": 2187, - "cost_for_plan": 0.745494255, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 2187 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 6.764540577, - "cost_without_join_buffer": 25.02637682, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 6.764540577, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 19683, - "cost_for_plan": 7.510034832, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 28.96624341 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 729, - "rows": 27, - "dups_cost": 7.510034832, - "write_cost": 0.02934619, - "full_lookup_cost": 3.16837251, - "total_cost": 10.70775353 - }, - { - "chosen_strategy": "FirstMatch" - } - ], - "sj_rows_out": 0.012345679, - "sj_rows_for_plan": 27, - "sj_filtered": 0.137174211, - "pruned_by_cost": true, - "current_cost": 28.96624341, - "best_cost": 0.811459244 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 2187, - "cost_for_plan": 0.745494255, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.222053862, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": "min_read_time" - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 243, - "cost_for_plan": 0.075081543, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.049238529, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.075081543, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_1", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.015203373, - "cost_without_join_buffer": 0.094543335, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.015203373, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_outer_2", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.067582275, - "cost_without_join_buffer": 0.850890015, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.067582275, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 729, - "cost_for_plan": 0.219286686, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.219286686, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.365980006 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.034460781, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.034460781, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.080024379, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.080024379, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.400440787, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.661998748, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.576512856 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.661998748, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.808692068 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.446004385, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 243, - "cost_for_plan": 0.114053628, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "table": "t_inner_2", - "rows_for_plan": 2187, - "cost_for_plan": 0.742727079, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 2187 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 6.764540577, - "cost_without_join_buffer": 25.02637682, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 6.764540577, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 19683, - "cost_for_plan": 7.507267656, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 729, - "rows": 27, - "dups_cost": 7.507267656, - "write_cost": 0.02934619, - "full_lookup_cost": 3.16837251, - "total_cost": 10.70498636 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.012345679, - "sj_rows_for_plan": 27, - "sj_filtered": 0.137174211, - "pruned_by_cost": true, - "current_cost": 10.70498636, - "best_cost": 0.808692068 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 2187, - "cost_for_plan": 0.742727079, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.219286686, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": "min_read_time" - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 3, - "cost": 0.145008465 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 3, - "dups_cost": 0.046471353, - "write_cost": 0.02548291, - "full_lookup_cost": 0.01303857, - "total_cost": 0.084992833 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 3, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.017419989, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.017419989, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.012618795, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.012618795, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.017419989, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.017419989, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_outer_2", - "rows_for_plan": 27, - "cost_for_plan": 0.102412822, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.034460781, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.034460781, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.080024379, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.080024379, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.136873603, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.398431564, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.312945672 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.398431564, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.545124884 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.182437201, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_inner_4", - "rows_for_plan": 9, - "cost_for_plan": 0.097611628, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.034303623, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.034303623, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.034303623, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.034303623, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "table": "t_outer_2", - "rows_for_plan": 81, - "cost_for_plan": 0.131915251, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.393473212, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.393473212, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.540166532 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 81, - "cost_for_plan": 0.131915251, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 27, - "cost_for_plan": 0.102412822, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_4", - "rows_for_plan": 27, - "cost_for_plan": 0.037231395, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_outer_2", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 2187, - "cost_for_plan": 0.731138787, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.731138787, - "best_cost": 0.540166532 - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 2187, - "cost_for_plan": 0.731138787, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.731138787, - "best_cost": 0.540166532 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_inner_2", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_3", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_2", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_4", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_3", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "", - "table": "t_outer_2", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_2", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_4", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_3", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "fix_semijoin_strategies_for_picked_join_order": [ - { - "semi_join_strategy": "DuplicateWeedout" - }, - { - "semi_join_strategy": "DuplicateWeedout" + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": [ - "t_outer_1", - "t_inner_1", - "t_inner_2", - "t_inner_4", - "t_outer_2", - "t_inner_3" - ], - "rows": 27, - "cost": 0.540166532 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t_inner_1.a = t_outer_1.a and t_inner_3.a = t_outer_2.a" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t_outer_1", + "table": "optimizer_context", "attached_condition": null - }, - { - "table": "t_inner_1", - "attached_condition": "t_inner_1.a = t_outer_1.a" - }, - { - "table": "t_inner_2", - "attached_condition": null - }, - { - "table": "t_inner_4", - "attached_condition": null - }, - { - "table": "t_outer_2", - "attached_condition": null - }, - { - "table": "t_inner_3", - "attached_condition": "t_inner_3.a = t_outer_2.a" } ] } @@ -7952,51 +3240,14 @@ 3 MATERIALIZED t_inner_3 ALL NULL NULL NULL NULL 9 Using join buffer (flat, BNL join) select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_inner_1.a from t2 t_inner_2, t1 t_inner_1) and -t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "join_preparation": { - "select_id": 2, - "steps": [ - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1" - } - ] - } - }, - { - "join_preparation": { - "select_id": 3, - "steps": [ - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4" - } - ] - } - }, - { - "expanded_query": "/* select#1 */ select t_outer_1.a AS a,t_outer_2.a AS a from t1 t_outer_1 join t2 t_outer_2 where t_outer_1.a in (/* select#2 */ select t_inner_1.a from t2 t_inner_2 join t1 t_inner_1) and t_outer_2.a in (/* select#3 */ select t_inner_3.a from t2 t_inner_3 join t1 t_inner_4)" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -8006,555 +3257,54 @@ "select_id": 1, "steps": [ { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "materialization", - "sjm_scan_allowed": true, - "possible": true - } - }, - { - "transformation": { - "select_id": 3, - "from": "IN (SELECT)", - "to": "semijoin", - "converted_to_semi_join": true - } - }, - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "1 and 1 and t_outer_1.a = t_inner_1.a and t_outer_2.a = t_inner_3.a", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "1 and 1 and multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "1 and 1 and multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(t_outer_1.a, t_inner_1.a) and multiple equal(t_outer_2.a, t_inner_3.a)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t_outer_1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_outer_2", - "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_2", - "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_1", - "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t_inner_3", - "table_scan": { - "rows": 9, - "read_cost": 0.011155245, - "read_and_compare_cost": 0.011443245 - } - }, - { - "table": "t_inner_4", + "table": "optimizer_context", "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } } ] }, { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { - "semijoin_table_pullout": { - "pulled_out_tables": [] - } - }, - { "table_dependencies": [ { - "table": "t_outer_1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t_outer_2", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_2", - "row_may_be_null": false, - "map_bit": 2, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_1", - "row_may_be_null": false, - "map_bit": 3, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_3", - "row_may_be_null": false, - "map_bit": 4, - "depends_on_map_bits": [] - }, - { - "table": "t_inner_4", - "row_may_be_null": false, - "map_bit": 5, - "depends_on_map_bits": [] } ] }, { - "execution_plan_for_potential_materialization": { - "steps": [ - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "rest_of_plan": [ - { - "plan_prefix": "t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804 - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_2", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "pruned_by_heuristic": true - } - ] - }, - { - "considered_execution_plans": [ - { - "plan_prefix": "", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_4", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "rest_of_plan": [ - { - "plan_prefix": "t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804 - } - ] - }, - { - "plan_prefix": "", - "table": "t_inner_3", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "pruned_by_heuristic": true - } - ] - } - ] - } - }, - { "considered_execution_plans": [ { "plan_prefix": "", "get_costs_for_tables": [ { "best_access_path": { - "table": "t_outer_1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.011443245, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.011443245, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -8563,1792 +3313,23 @@ }, { "plan_prefix": "", - "table": "t_outer_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.011523207, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.011523207, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.014133225, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.014133225, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_outer_2", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.050443503, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.050443503, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_1", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.024600489, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.024600489, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.024600489, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.024600489, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.050443503, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.050443503, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_1", - "rows_for_plan": 81, - "cost_for_plan": 0.049238529, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.067582275, - "cost_without_join_buffer": 0.850890015, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.067582275, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 729, - "cost_for_plan": 0.222053862, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.23517089 - }, - { - "strategy": "SJ-Materialization", - "rows": 27, - "cost": 0.083958496 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.222053862, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.368747182 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.034460781, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.034460781, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.080024379, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.080024379, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.118419277, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.379977238, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.294491346 - }, - { - "strategy": "SJ-Materialization", - "rows": 27, - "cost": 0.143278952 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.379977238, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.526670558 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.163982875, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.163982875, - "best_cost": 0.143278952 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_4", - "rows_for_plan": 243, - "cost_for_plan": 0.116820804, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_outer_2,t_inner_1", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.222053862, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.222053862, - "best_cost": 0.143278952 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 243, - "cost_for_plan": 0.075081543, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.049238529, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.075081543, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_1", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.015203373, - "cost_without_join_buffer": 0.094543335, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.015203373, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.024443331, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.024443331, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_outer_2", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.067582275, - "cost_without_join_buffer": 0.850890015, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.067582275, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.172815333, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.172815333, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 729, - "cost_for_plan": 0.219286686, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.219286686, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.365980006 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "pruned_by_cost": true, - "current_cost": 0.365980006, - "best_cost": 0.143278952 - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 243, - "cost_for_plan": 0.114053628, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "table": "t_inner_2", - "rows_for_plan": 2187, - "cost_for_plan": 0.742727079, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.742727079, - "best_cost": 0.143278952 - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 2187, - "cost_for_plan": 0.742727079, - "semijoin_strategy_choice": [ - { - "strategy": "SJ-Materialization", - "rows": 81, - "cost": 0.116338225 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 81, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_3", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_3", - "table": "t_inner_2", - "rows_for_plan": 729, - "cost_for_plan": 0.377896186, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 1.00428504, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 1.15097836 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "pruned_by_cost": true, - "current_cost": 1.15097836, - "best_cost": 0.143278952 - } - ] - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.219286686, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.219286686, - "best_cost": 0.143278952 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_2", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 3, - "cost": 0.145008465 - }, - { - "strategy": "SJ-Materialization", - "rows": 3, - "cost": 0.065137975 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 3, - "dups_cost": 0.046471353, - "write_cost": 0.02548291, - "full_lookup_cost": 0.01303857, - "total_cost": 0.084992833 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 3, - "sj_filtered": 3.703703704, - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.017419989, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.017419989, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.012618795, - "cost_without_join_buffer": 0.031514445, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.012618795, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.017419989, - "cost_without_join_buffer": 0.034329735, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.017419989, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_outer_2", - "rows_for_plan": 27, - "cost_for_plan": 0.082557964, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_4", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.034460781, - "cost_without_join_buffer": 0.283630005, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.034460781, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.080024379, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.080024379, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "table": "t_inner_4", - "rows_for_plan": 81, - "cost_for_plan": 0.117018745, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.378576706, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "rows": 27, - "cost": 1.293090814 - }, - { - "strategy": "SJ-Materialization", - "rows": 27, - "cost": 0.14187842 - }, - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 27, - "tmp_table_rows": 1, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.378576706, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.525270026 - }, - { - "chosen_strategy": "SJ-Materialization" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.162582343, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.162582343, - "best_cost": 0.14187842 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_inner_4", - "rows_for_plan": 9, - "cost_for_plan": 0.07775677, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.034303623, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.034303623, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 9 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.034303623, - "cost_without_join_buffer": 0.102989205, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.034303623, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "table": "t_outer_2", - "rows_for_plan": 81, - "cost_for_plan": 0.112060393, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 81 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.261557961, - "cost_without_join_buffer": 0.926902845, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.261557961, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 729, - "cost_for_plan": 0.373618354, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "prefix_row_count": 3, - "tmp_table_rows": 9, - "sj_inner_fanout": 27, - "rows": 27, - "dups_cost": 0.373618354, - "write_cost": 0.02934619, - "full_lookup_cost": 0.11734713, - "total_cost": 0.520311674 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "sj_rows_out": 0.333333333, - "sj_rows_for_plan": 27, - "sj_filtered": 3.703703704, - "pruned_by_cost": true, - "current_cost": 0.520311674, - "best_cost": 0.14187842 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 81, - "cost_for_plan": 0.112060393, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_2", - "table": "t_inner_3", - "rows_for_plan": 27, - "cost_for_plan": 0.082557964, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_4", - "rows_for_plan": 27, - "cost_for_plan": 0.037231395, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_outer_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 27 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.065233941, - "cost_without_join_buffer": 0.308967615, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.065233941, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_outer_2", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t_inner_2", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - }, - { - "best_access_path": { - "table": "t_inner_3", - "plan_details": { - "record_count": 243 - }, - "considered_access_paths": [ - { - "access_type": "scan_with_join_cache", - "rows": 9, - "rows_after_filter": 9, - "rows_out": 9, - "cost": 0.628673451, - "cost_without_join_buffer": 2.780708535, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 9, - "rows_out": 9, - "cost": 0.628673451, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "table": "t_inner_2", - "rows_for_plan": 2187, - "cost_for_plan": 0.731138787, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.731138787, - "best_cost": 0.14187842 - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2", - "table": "t_inner_3", - "rows_for_plan": 2187, - "cost_for_plan": 0.731138787, - "semijoin_strategy_choice": [], - "pruned_by_cost": true, - "current_cost": 0.731138787, - "best_cost": 0.14187842 - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_inner_2", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1,t_inner_1,t_inner_4", - "table": "t_inner_3", - "rows_for_plan": 243, - "cost_for_plan": 0.102465336, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1,t_inner_1", - "table": "t_inner_3", - "rows_for_plan": 81, - "cost_for_plan": 0.046471353, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_2", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_4", - "rows_for_plan": 9, - "cost_for_plan": 0.022028022, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "t_outer_1", - "table": "t_inner_3", - "rows_for_plan": 27, - "cost_for_plan": 0.02463804, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "plan_prefix": "", - "table": "t_outer_2", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_1", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_2", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_4", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - }, - { - "plan_prefix": "", - "table": "t_inner_3", - "rows_for_plan": 9, - "cost_for_plan": 0.011443245, - "semijoin_strategy_choice": [], - "pruned_by_heuristic": true - } - ] - }, - { - "fix_semijoin_strategies_for_picked_join_order": [ - { - "semi_join_strategy": "SJ-Materialization", - "join_order": [ - { - "table": "t_inner_4" - }, - { - "table": "t_inner_3" - } - ] - }, - { - "semi_join_strategy": "SJ-Materialization", - "join_order": [ - { - "table": "t_inner_1" - }, - { - "table": "t_inner_2" - } - ] + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": [ - "t_outer_1", - "", - "t_outer_2", - "" - ], - "rows": 27, - "cost": 0.14187842 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "condition_on_constant_tables": "1", - "computing_condition": [] - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t_outer_1", - "attached_condition": null - }, - { - "table": "t_inner_1", - "attached_condition": null - }, - { - "table": "t_inner_2", - "attached_condition": null - }, - { - "table": "", - "attached_condition": null - }, - { - "table": "t_outer_2", - "attached_condition": null - }, - { - "table": "t_inner_4", - "attached_condition": null - }, - { - "table": "t_inner_3", - "attached_condition": null - }, - { - "table": "", + "table": "optimizer_context", "attached_condition": null } ] @@ -10392,55 +3373,13 @@ 1 SIMPLE t1 ref a_b a_b 10 const,const 1 Using index select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "a_b", - "ranges": - ["(2,4) <= (a,b) <= (2,4)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 1, - "cost": 0.001478954, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL explain select * from t1 where a >= 900 and b between 10 and 20; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a_b a_b 10 NULL 107 Using where; Using index select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "a_b", - "ranges": - ["(900,10) <= (a,b)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": true, - "rows": 107, - "cost": 0.016135574, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t0,t1; create table t1 (start_date date, end_date date, filler char(100), key(start_date, end_date)) ; insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k; @@ -10449,28 +3388,7 @@ 1 SIMPLE t1 range start_date start_date 8 NULL 1000 Using index condition select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "start_date", - "ranges": - ["(2019-02-10,NULL) < (start_date,end_date)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 1000, - "cost": 1.235690484, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1,one_k; create table ten(a int); insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -10487,28 +3405,7 @@ 1 SIMPLE t1 range a_b_c a_b_c 8 NULL 4 Using index condition select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "a_b_c", - "ranges": - ["(1) <= (a,b) < (4,50)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 4, - "cost": 0.00627616, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table ten,t1; # Ported test from MYSQL for ranges involving Binary column CREATE TABLE t1(i INT PRIMARY KEY, b BINARY(16), INDEX i_b(b)); @@ -10517,57 +3414,17 @@ EXPLAIN SELECT * FROM t1 WHERE b IN (0xD95B94336A9946A39CF5B58CFE772D8C); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 17 const 1 Using index condition +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C) <= (b) <= (\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C), ] doesn't exist in the list of ranges for table_name test.t1 and index_name i_b select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C) <= (b) <= (\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL EXPLAIN SELECT * FROM t1 WHERE b IS NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 17 const 1 Using index condition select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(NULL) <= (b) <= (NULL)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; # # MDEV-18880: Optimizer trace prints date in hexadecimal @@ -10579,117 +3436,41 @@ EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(ab\x0A) <= (b) <= (ab\x0A), ] doesn't exist in the list of ranges for table_name test.t1 and index_name i_b select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\x0A) <= (b) <= (ab\x0A)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL ALTER TABLE t1 modify column b BINARY(10) AFTER i; EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(ab\x0A\x00\x00\x00\x00\x00\x00\x00) <= (b) <= (ab\x0A\x00\x00\x00\x00\x00\x00\x00), ] doesn't exist in the list of ranges for table_name test.t1 and index_name i_b select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\x0A\x00\x00\x00\x00\x00\x00\x00) <= (b) <= (ab\x0A\x00\x00\x00\x00\x00\x00\x00)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL ALTER TABLE t1 modify column b VARBINARY(10) AFTER i; EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(ab\x0A) <= (b) <= (ab\x0A), ] doesn't exist in the list of ranges for table_name test.t1 and index_name i_b select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\x0A) <= (b) <= (ab\x0A)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; CREATE TABLE t1(i INT PRIMARY KEY, b CHAR(10), INDEX i_b(b)) CHARSET=latin1; INSERT INTO t1 VALUES (1, 'ab\n'); INSERT INTO t1 VALUES (2, NULL); EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 459. select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\n) <= (b) <= (ab\n)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; CREATE TABLE t1(i INT PRIMARY KEY, b blob , INDEX i_b(b)); Warnings: @@ -10700,30 +3481,11 @@ EXPLAIN SELECT * FROM t1 WHERE b= 'ab\n'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i_b i_b 1003 const 1 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(ab\x0A) <= (b) <= (ab\x0A), ] doesn't exist in the list of ranges for table_name test.t1 and index_name i_b select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\x0A) <= (b) <= (ab\x0A)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 1, - "cost": 0.002574553, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10), INDEX i_b(b)) CHARSET=latin1; INSERT INTO t1 VALUES (1, 'ab\n'); @@ -10731,31 +3493,12 @@ set optimizer_trace=1; EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i_b i_b 13 const 2 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 459. select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "i_b", - "ranges": - ["(ab\n) <= (b) <= (ab\n)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 0.003808422, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -10790,28 +3533,7 @@ } select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "start_date", - "ranges": - ["(2019-02-10,NULL) < (start_date,end_date)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 1000, - "cost": 1.235690484, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1, t0, one_k; # # MDEV-19776: Assertion `to_len >= 8' failed in convert_to_printable with optimizer trace enabled @@ -10856,7 +3578,7 @@ { "best_access_path": { - "table": "A", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -10865,40 +3587,10 @@ [ { "access_type": "scan", - "rows": 10, - "rows_after_filter": 5, - "rows_out": 5, - "cost": 0.01159965, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": - { - "type": "scan", - "rows_read": 5, - "rows_out": 5, - "cost": 0.01159965, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": - { - "table": "B", - "plan_details": - { - "record_count": 1 - }, - "considered_access_paths": - [ - { - "access_type": "scan", - "rows": 1000, - "rows_after_filter": 800, - "rows_out": 800, - "cost": 0.1669214, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } @@ -10906,9 +3598,9 @@ "chosen_access_method": { "type": "scan", - "rows_read": 800, - "rows_out": 800, - "cost": 0.1669214, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -10917,61 +3609,9 @@ }, { "plan_prefix": "", - "table": "A", - "rows_for_plan": 5, - "cost_for_plan": 0.01159965, - "rest_of_plan": - [ - { - "plan_prefix": "A", - "get_costs_for_tables": - [ - { - "best_access_path": - { - "table": "B", - "plan_details": - { - "record_count": 5 - }, - "considered_access_paths": - [ - { - "access_type": "scan", - "rows": 1000, - "rows_after_filter": 800, - "rows_out": 800, - "cost": 0.8329686, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": - { - "type": "scan", - "rows_read": 800, - "rows_out": 800, - "cost": 0.8329686, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "A", - "table": "B", - "rows_for_plan": 4000, - "cost_for_plan": 0.84456825 - } - ] - }, - { - "plan_prefix": "", - "table": "B", - "rows_for_plan": 800, - "cost_for_plan": 0.1669214, - "pruned_by_heuristic": true + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] ] @@ -10992,7 +3632,7 @@ { "best_access_path": { - "table": "A", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -11001,40 +3641,10 @@ [ { "access_type": "scan", - "rows": 10, - "rows_after_filter": 10, - "rows_out": 10, - "cost": 0.01159965, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": - { - "type": "scan", - "rows_read": 10, - "rows_out": 10, - "cost": 0.01159965, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": - { - "table": "B", - "plan_details": - { - "record_count": 1 - }, - "considered_access_paths": - [ - { - "access_type": "scan", - "rows": 1000, - "rows_after_filter": 800, - "rows_out": 800, - "cost": 0.1669214, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } @@ -11042,9 +3652,9 @@ "chosen_access_method": { "type": "scan", - "rows_read": 800, - "rows_out": 800, - "cost": 0.1669214, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -11053,74 +3663,9 @@ }, { "plan_prefix": "", - "table": "A", - "rows_for_plan": 10, - "cost_for_plan": 0.01159965, - "rest_of_plan": - [ - { - "plan_prefix": "A", - "get_costs_for_tables": - [ - { - "best_access_path": - { - "table": "B", - "plan_details": - { - "record_count": 10 - }, - "considered_access_paths": - [ - { - "access_type": "ref", - "index": "b", - "used_range_estimates": false, - "reason": "not available", - "rows": 1, - "cost": 0.01901531, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": - { - "type": "ref", - "index": "b", - "rows_read": 1, - "rows_out": 1, - "cost": 0.01901531, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "A", - "table": "B", - "rows_for_plan": 10, - "cost_for_plan": 0.03061496, - "pushdown_cond_selectivity": 0.8, - "filtered": 80, - "rows_out": 0.8, - "selectivity": 0.8, - "estimated_join_cardinality": 8 - } - ] - }, - { - "plan_prefix": "", - "table": "B", - "rows_for_plan": 800, - "cost_for_plan": 0.1669214, - "pruned_by_cost": true, - "current_cost": 0.1669214, - "best_cost": 0.03061496 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] ] @@ -11177,15 +3722,7 @@ 1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) select JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) -[ - { - "pulled_out_tables": - [ - "t2", - "t1" - ] - } -] +NULL drop table t1,t2,t3; # # MDEV-22401: Optimizer trace: multi-component range is not printed correctly @@ -11236,37 +3773,7 @@ { "best_access_path": { - "table": "t1", - "plan_details": - { - "record_count": 1 - }, - "considered_access_paths": - [ - { - "access_type": "scan", - "rows": 10, - "rows_after_filter": 10, - "rows_out": 10, - "cost": 0.01159965, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": - { - "type": "scan", - "rows_read": 10, - "rows_out": 10, - "cost": 0.01159965, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": - { - "table": "t2", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -11278,10 +3785,9 @@ "rows": 100, "rows_after_filter": 100, "rows_out": 100, - "cost": 0.0256761, + "cost": 0.0243234, "index_only": false, - "chosen": true, - "use_tmp_table": true + "chosen": true } ], "chosen_access_method": @@ -11289,7 +3795,7 @@ "type": "scan", "rows_read": 100, "rows_out": 100, - "cost": 0.0256761, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -11298,125 +3804,9 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 10, - "cost_for_plan": 0.01159965, - "rest_of_plan": - [ - { - "plan_prefix": "t1", - "get_costs_for_tables": - [ - { - "best_access_path": - { - "table": "t2", - "plan_details": - { - "record_count": 10 - }, - "considered_access_paths": - [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not available", - "rows": 1, - "cost": 0.01840091, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": - { - "type": "ref", - "index": "a", - "rows_read": 1, - "rows_out": 1, - "cost": 0.01840091, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "t1", - "table": "t2", - "rows_for_plan": 10, - "cost_for_plan": 0.03000056, - "cost_for_sorting": 0.006368384 - } - ] - }, - { - "plan_prefix": "", - "table": "t2", + "table": "optimizer_context", "rows_for_plan": 100, - "cost_for_plan": 0.0256761, - "rest_of_plan": - [ - { - "plan_prefix": "t2", - "get_costs_for_tables": - [ - { - "best_access_path": - { - "table": "t1", - "plan_details": - { - "record_count": 100 - }, - "considered_access_paths": - [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not available", - "rows": 1, - "cost": 0.1821659, - "chosen": true - }, - { - "access_type": "scan_with_join_cache", - "rows": 10, - "rows_after_filter": 10, - "rows_out": 1, - "cost": 0.11055225, - "cost_without_join_buffer": 1.159965, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": - { - "type": "scan", - "rows_read": 10, - "rows_out": 1, - "cost": 0.11055225, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "t2", - "table": "t1", - "rows_for_plan": 100, - "cost_for_plan": 0.13622835, - "pruned_by_cost": true, - "current_cost": 0.13622835, - "best_cost": 0.036368944 - } - ] + "cost_for_plan": 0.0243234 } ] ] @@ -11439,22 +3829,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` between 1 and 5 and `test`.`t1`.`b` <= 5 select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - [ - { - "column_name": "a", - "ranges": - ["1 <= a <= 5"], - "selectivity_from_histogram": 0.05 - }, - { - "column_name": "b", - "ranges": - ["NULL < b <= 5"], - "selectivity_from_histogram": 0.05 - } - ] -] +NULL EXPLAIN EXTENDED SELECT * from t1 WHERE a != 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 99.00 Using where @@ -11462,19 +3837,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` <> 5 select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - [ - { - "column_name": "a", - "ranges": - [ - "NULL < a < 5", - "5 < a" - ], - "selectivity_from_histogram": 0.99 - } - ] -] +NULL EXPLAIN EXTENDED SELECT * from t1 WHERE b >= 10 and b < 25; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 15.00 Using where @@ -11482,16 +3845,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` >= 10 and `test`.`t1`.`b` < 25 select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - [ - { - "column_name": "b", - "ranges": - ["10 <= b < 25"], - "selectivity_from_histogram": 0.15 - } - ] -] +NULL drop table t1; # # MDEV-22910:SIGSEGV in Opt_trace_context::is_started & SIGSEGV in Json_writer::add_table_name @@ -11597,24 +3951,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.setup_range_conditions')) -[ - [ - { - "enforce_sel_arg_weight_limit": - { - "index": "c1", - "old_weight": 74806, - "new_weight": 1776 - } - }, - { - "sel_arg_alloc_limit_hit": - { - "alloced_sel_args": 16001 - } - } - ] -] +NULL drop table t1; # # MDEV-31085: multi-update using view with optimizer trace enabled @@ -12098,12 +4435,7 @@ select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS from information_schema.optimizer_trace; JS -[ - { - "split_candidates": - ["t10.grp_id"] - } -] +NULL select json_detailed( json_remove( @@ -12113,37 +4445,7 @@ ) as JS from information_schema.optimizer_trace; JS -[ - { - "considered_keys": - [ - { - "table_name": "t10", - "index": "grp_id", - "rec_per_key": 100, - "param_tables": 1 - } - ], - "refills": 5, - "spl_pd_boundary": 2, - "split_plan_search": - [], - "split_materialized": - { - "table": "t10", - "key": "grp_id", - "org_cost": 1.159965, - "postjoin_cost": 4.020888502, - "one_splitting_cost": 5.180853502, - "unsplit_postjoin_cost": 159.1588125, - "unsplit_cost": 275.1553125, - "rows": 100, - "refills": 5, - "total_splitting_cost": 25.90426751, - "chosen": true - } - } -] +NULL drop table t1,t2,t3,t10,t11; set optimizer_trace=DEFAULT; # @@ -12317,15 +4619,7 @@ select JSON_DETAILED(JSON_EXTRACT(trace, '$**.mark_join_nest_as_const')) as jd from information_schema.optimizer_trace; jd -[ - { - "members": - [ - "t3", - "t2" - ] - } -] +NULL drop table t0, t1, t2, t3; # # MDEV-23767: IN-to-subquery conversion is not visible in optimizer trace @@ -12336,75 +4630,25 @@ set in_predicate_conversion_threshold=3; explain select * from t0 where a in (1,2,3,4,5,6); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t0.a 1 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where select json_detailed(json_extract(trace, '$**.in_to_subquery_conversion')) as jd from information_schema.optimizer_trace; jd -[ - { - "item": "t0.a in (1,2,3,4,5,6)", - "conversion": - [ - { - "join_preparation": - { - "select_id": 2, - "steps": - [ - { - "derived": - { - "table": "tvc_0", - "select_id": 3, - "algorithm": "materialized" - } - }, - { - "transformation": - { - "select_id": 2, - "from": "IN (SELECT)", - "to": "semijoin", - "chosen": true - } - }, - { - "expanded_query": "/* select#2 */ select tvc_0._col_1 from (values (1),(2),(3),(4),(5),(6)) tvc_0" - } - ] - } - } - ] - } -] +NULL explain select * from t0 where a in (1,2,3,4,5,a+1); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where select json_detailed(json_extract(trace, '$**.in_to_subquery_conversion')) as jd from information_schema.optimizer_trace; jd -[ - { - "item": "t0.a in (1,2,3,4,5,t0.a + 1)", - "done": false, - "reason": "non-constant element in the IN-list" - } -] +NULL explain select * from t0 where a in ('1','2','3','4','5','6'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where select json_detailed(json_extract(trace, '$**.in_to_subquery_conversion')) as jd from information_schema.optimizer_trace; jd -[ - { - "item": "t0.a in ('1','2','3','4','5','6')", - "done": false, - "reason": "type mismatch" - } -] +NULL set in_predicate_conversion_threshold=@tmp; drop table t0; # @@ -12469,19 +4713,14 @@ set @sub_path= substr(@path, 2, locate('.best_access_path', @path)-2); select @sub_path; @sub_path -$.steps[1].join_optimization.steps[4].considered_execution_plans[1].rest_of_plan[0].get_costs_for_tables[0] +NULL select json_detailed(json_extract( @trace, concat(@sub_path,'.best_access_path.considered_access_paths[0]') )) as S; S -{ - "access_type": "ref", - "index": "PRIMARY", - "chosen": false, - "cause": "no predicate for first keypart" -} +NULL drop table t1,t2,t3; # # MDEV-23645: Optimizer trace: print conditions after substitute_for_best_equal_field @@ -12507,16 +4746,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.substitute_best_equal')) -[ - { - "condition": "WHERE", - "resulting_condition": "t1.a = 3" - }, - { - "condition": "HAVING", - "resulting_condition": "t1.a + t1.b < 10" - } -] +NULL # Check ON expression explain select @@ -12532,17 +4762,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.substitute_best_equal')) -[ - { - "condition": "WHERE", - "resulting_condition": "t1.b > 5555" - }, - { - "condition": "ON expr", - "attached_to": "t2", - "resulting_condition": "t2.a = t1.a and t1.a < 3" - } -] +NULL # Check nested ON expression explain select @@ -12559,17 +4779,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.substitute_best_equal')) -[ - { - "condition": "WHERE", - "resulting_condition": "t1.b > 5555" - }, - { - "condition": "ON expr", - "attached_to": "t2", - "resulting_condition": "t2.a = t1.a and t3.a = t1.a and t1.a + t1.a < 1000" - } -] +NULL # The next query is test for: # MDEV-23646: Optimizer trace: optimize_cond() should show ON expression processing select @@ -12577,35 +4787,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.condition_processing')) -[ - { - "condition": "WHERE", - "original_condition": "t1.b > 5555", - "steps": - [ - { - "build_equal_items": - { - "condition": "ON expr", - "attached_to": "t3", - "resulting_condition": "t3.a + t2.a < 1000 and multiple equal(t2.a, t1.a, t3.a)" - } - }, - { - "transformation": "equality_propagation", - "resulting_condition": "t1.b > 5555" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.b > 5555" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.b > 5555" - } - ] - } -] +NULL drop table t1,t2,t3; # # MDEV-24325: Optimizer trace doesn't cover LATERAL DERIVED @@ -12647,96 +4829,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.choose_best_splitting')) -[ - { - "considered_keys": - [] - }, - { - "considered_keys": - [ - { - "table_name": "t2", - "index": "idx_a", - "rec_per_key": 1.8367, - "param_tables": 1 - } - ], - "refills": 4, - "spl_pd_boundary": 2, - "split_plan_search": - [ - { - "considered_execution_plans": - [ - { - "plan_prefix": "", - "get_costs_for_tables": - [ - { - "best_access_path": - { - "table": "t2", - "plan_details": - { - "record_count": 1 - }, - "considered_access_paths": - [ - { - "access_type": "ref", - "index": "idx_a", - "used_range_estimates": false, - "reason": "not available", - "rows": 1.8367, - "cost": 0.002051185, - "chosen": true - }, - { - "type": "scan", - "chosen": false, - "cause": "cost" - } - ], - "chosen_access_method": - { - "type": "ref", - "index": "idx_a", - "rows_read": 1.8367, - "rows_out": 1.8367, - "cost": 0.002051185, - "uses_join_buffering": false - } - } - } - ] - }, - { - "plan_prefix": "", - "table": "t2", - "rows_for_plan": 1.8367, - "cost_for_plan": 0.002051185, - "cost_for_sorting": 0.001155201 - } - ] - } - ], - "split_materialized": - { - "table": "t2", - "key": "idx_a", - "org_cost": 0.002051185, - "postjoin_cost": 0.001135418, - "one_splitting_cost": 0.003186603, - "unsplit_postjoin_cost": 0.036032575, - "unsplit_cost": 0.060625425, - "rows": 1.8367, - "refills": 4, - "total_splitting_cost": 0.012746412, - "chosen": true - } - } -] +NULL drop table t1,t2; # # Test table functions. @@ -12933,14 +5026,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 9 (2%) Using index condition; Using where; Using rowid filter QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where a<10 and b between 10 and 50 and c < 10 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a,t1.b AS b,t1.c AS c from t1 where t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -12950,136 +5043,21 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 1000, - "cost": 0.1671618 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": true, - "key_parts": ["a"] - }, - { - "index": "b", - "usable": true, - "key_parts": ["b"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a", - "ranges": ["(NULL) < (a) < (10)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 9, - "cost": 0.012445505, - "chosen": true - }, - { - "index": "b", - "ranges": ["(10) <= (b) <= (50)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 21, - "cost": 0.027251933, - "chosen": false, - "cause": "cost" - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "a", - "rows": 9, - "ranges": ["(NULL) < (a) < (10)"] - }, - "rows_for_plan": 9, - "cost_for_plan": 0.012445505, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "a", - "build_cost": 0.001846537, - "rows": 9 - }, - { - "key": "b", - "build_cost": 0.003322634, - "rows": 21 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "a", - "selectivity_from_index": 0.009 - }, - { - "index_name": "b", - "selectivity_from_index": 0.021 - } - ], - "selectivity_for_columns": [ - { - "column_name": "c", - "ranges": ["NULL < c < 10"], - "selectivity_from_histogram": 0.094 - } - ], - "cond_selectivity": 0.000017766 } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -13093,45 +5071,27 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "filter": { - "rowid_filter_index": "b", - "index_only_cost": 0.001605807, - "filter_startup_cost": 0.003322634, - "find_key_and_filter_lookup_cost": 6.695354e-4, - "filter_selectivity": 0.021, - "original_rows": 9, - "new_rows": 0.189, - "original_access_cost": 0.011607363, - "with_filter_access_cost": 0.002485375, - "original_found_rows_cost": 0.010001556, - "with_filter_found_rows_cost": 2.100327e-4, - "org_cost": 0.011895363, - "filter_cost": 0.005814057, - "filter_used": true - }, - "access_type": "range", - "range_index": "a", - "rows": 9, - "rows_after_filter": 0.189, - "rows_out": 0.017766, - "cost": 0.006364199, + "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": "a", - "rows_read": 0.189, - "rows_out": 0.017766, - "cost": 0.006364199, - "uses_join_buffering": false, - "rowid_filter_index": "b" + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, + "uses_join_buffering": false } } } @@ -13139,88 +5099,30 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 0.017766, - "cost_for_plan": 0.006364199, - "pushdown_cond_selectivity": 0.094, - "filtered": 0.1974, - "rows_out": 0.017766 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 0.017766, - "cost": 0.006364199 - }, - { - "table": "t1", - "range_analysis": { - "potential_range_indexes": [ - { - "index": "a", - "usable": false, - "cause": "not applicable" - }, - { - "index": "b", - "usable": true, - "key_parts": ["b"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b", - "ranges": ["(10) <= (b) <= (50)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": true, - "rows": 21, - "cost": 0.004244354, - "chosen": true - } - ] - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "b", - "rows": 21, - "ranges": ["(10) <= (b) <= (50)"] - }, - "rows_for_plan": 21, - "cost_for_plan": 0.004244354, - "chosen": true - } - } - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10" + "table": "optimizer_context", + "attached_condition": null } ] } }, { - "make_join_readinfo": [ - { - "table": "t1", - "index_condition": "t1.a < 10", - "row_condition": "t1.b between 10 and 50 and t1.c < 10" - } - ] + "make_join_readinfo": [] } ] } @@ -13322,14 +5224,14 @@ } } QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select three.a AS a,t1.a AS a,t1.b AS b,t1.c AS c from three join t1 where t1.a = three.a and t1.b < 5000 and t1.c < 1000" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -13339,131 +5241,24 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [ - { - "table": "t1", - "index": "a", - "field": "a", - "equals": "three.a", - "null_rejecting": true - } - ] - }, - { "rows_estimation": [ { - "table": "three", + "table": "optimizer_context", "table_scan": { - "rows": 3, - "read_cost": 0.010408815, - "read_and_compare_cost": 0.010504815 - } - }, - { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 10000, - "cost": 1.581538 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": false, - "cause": "not applicable" - }, - { - "index": "b", - "usable": true, - "key_parts": ["b"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b", - "ranges": ["(NULL) < (b) < (5000)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 4312, - "cost": 5.324909012, - "chosen": false, - "cause": "cost" - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "not single_table" - } + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "table": "t1", - "rowid_filters": [ - { - "key": "b", - "build_cost": 0.611716709, - "rows": 4312 - } - ] - }, - { - "selectivity_for_indexes": [ - { - "index_name": "b", - "selectivity_from_index": 0.4312 - } - ], - "selectivity_for_columns": [ - { - "column_name": "c", - "ranges": ["NULL < c < 1000"], - "selectivity_from_histogram": 0.0999 - } - ], - "cond_selectivity": 0.04307688 } ] }, { "table_dependencies": [ { - "table": "three", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] - }, - { - "table": "t1", - "row_may_be_null": false, - "map_bit": 1, - "depends_on_map_bits": [] } ] }, @@ -13474,52 +5269,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "three", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { "access_type": "scan", - "rows": 3, - "rows_after_filter": 3, - "rows_out": 3, - "cost": 0.010504815, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 3, - "rows_out": 3, - "cost": 0.010504815, - "uses_join_buffering": false - } - } - }, - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 1 - }, - "considered_access_paths": [ - { - "access_type": "scan", - "rows": 10000, - "rows_after_filter": 430.7688, - "rows_out": 430.7688, - "cost": 1.581538, + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", - "rows_read": 430.7688, - "rows_out": 430.7688, - "cost": 1.581538, + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -13528,157 +5297,24 @@ }, { "plan_prefix": "", - "table": "three", - "rows_for_plan": 3, - "cost_for_plan": 0.010504815, - "rest_of_plan": [ - { - "plan_prefix": "three", - "get_costs_for_tables": [ - { - "best_access_path": { - "table": "t1", - "plan_details": { - "record_count": 3 - }, - "considered_access_paths": [ - { - "access_type": "ref", - "index": "a", - "used_range_estimates": false, - "reason": "not available", - "filter": { - "rowid_filter_index": "b", - "index_only_cost": 0.092096742, - "filter_startup_cost": 0.611716709, - "find_key_and_filter_lookup_cost": 0.094772697, - "filter_selectivity": 0.4312, - "original_rows": 1000, - "new_rows": 431.2, - "original_access_cost": 1.203380742, - "with_filter_access_cost": 0.6660551, - "original_found_rows_cost": 1.111284, - "with_filter_found_rows_cost": 0.479185661, - "org_cost": 3.706142226, - "filter_cost": 2.651277209, - "filter_used": true - }, - "rows": 431.2, - "cost": 2.651277209, - "chosen": true - }, - { - "access_type": "scan_with_join_cache", - "rows": 10000, - "rows_after_filter": 430.7688, - "rows_out": 323.0766, - "cost": 1.701731924, - "cost_without_join_buffer": 4.7319164, - "index_only": false, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "rows_read": 430.7688, - "rows_out": 323.0766, - "cost": 1.701731924, - "uses_join_buffering": true - } - } - } - ] - }, - { - "plan_prefix": "three", - "table": "t1", - "rows_for_plan": 969.2298, - "cost_for_plan": 1.712236739, - "pushdown_cond_selectivity": 0.75, - "filtered": 3.230766, - "rows_out": 323.0766 - } - ] - }, - { - "plan_prefix": "", - "table": "t1", - "rows_for_plan": 430.7688, - "cost_for_plan": 1.581538, - "pruned_by_heuristic": true + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["three", "t1"], - "rows": 969.2298, - "cost": 1.712236739 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { - "attached_conditions_computation": [ - { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 10000, - "cost": 1.581538 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": true, - "key_parts": ["a"] - }, - { - "index": "b", - "usable": true, - "key_parts": ["b"] - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "a" - }, - { - "index": "b", - "ranges": ["(NULL) < (b) < (5000)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 4312, - "cost": 5.324909012, - "chosen": false, - "cause": "cost" - } - ], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - "group_index_range": { - "chosen": false, - "cause": "not single_table" - } - } - } - ], + "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "three", + "table": "optimizer_context", "attached_condition": null - }, - { - "table": "t1", - "attached_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000" } ] } @@ -13786,16 +5422,7 @@ select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1 from information_schema.optimizer_trace; out1 -[ - { - "table": "t2", - "used_partitions": "p2,p3,p4" - }, - { - "table": "t3", - "used_partitions": "p4,p5" - } -] +NULL drop table t2,t3; create table t1 ( a int @@ -13811,12 +5438,7 @@ select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1 from information_schema.optimizer_trace; out1 -[ - { - "table": "t1", - "used_partitions": "" - } -] +NULL drop table t1; set @@optimizer_switch= @save_optimizer_switch; set @@use_stat_tables= @save_use_stat_tables; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_trace/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_range [ pass ] 294 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.sargable_date_cond [ fail ] Test ended at 2026-04-23 23:10:14 CURRENT_TEST: main.sargable_date_cond --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sargable_date_cond.result 2026-04-02 14:38:09.450657394 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sargable_date_cond.reject 2026-04-23 23:10:14.454845298 +0300 @@ -1723,7 +1723,7 @@ { "query_block": { "select_id": 1, - "cost": 0.003808422, + "cost": 0.001617224, "nested_loop": [ { "table": { @@ -1735,7 +1735,7 @@ "used_key_parts": ["a"], "loops": 1, "rows": 2, - "cost": 0.003808422, + "cost": 0.001617224, "filtered": 100, "index_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'", "attached_condition": "t1.c < (subquery#2)" Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.sargable_date_cond/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist main.sp [ fail ] Test ended at 2026-04-23 23:10:22 CURRENT_TEST: main.sp /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//t1.frm' (Errcode: 2 "No such file or directory") /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//t1.MYD' (Errcode: 2 "No such file or directory") --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sp.result 2026-04-17 18:40:40.498802332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sp.reject 2026-04-23 23:10:22.248623816 +0300 @@ -5968,23 +5968,15 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref c1 c1 5 const 1 Using index EXPLAIN SELECT * FROM t1 WHERE c1=f1(); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index EXPLAIN SELECT * FROM v1 WHERE c1=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref c1 c1 5 const 1 Using index EXPLAIN SELECT * FROM v1 WHERE c1=f1(); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index EXPLAIN SELECT * FROM t1 WHERE c1=f2(10); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c1 c1 5 const 1 Using where; Using index EXPLAIN SELECT * FROM t1 WHERE c1=f2(c1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index +ReplayTest: Query error: FUNCTION test.f2 does not exist EXPLAIN SELECT * FROM t1 WHERE c1=f2(rand()); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL c1 5 NULL 5 Using where; Using index +ReplayTest: Query error: FUNCTION test.f2 does not exist DROP VIEW v1; DROP FUNCTION f1; DROP FUNCTION f2; @@ -8736,8 +8728,7 @@ insert into t2 select mod(seq,100), seq from seq_1_to_1000; explain select f1(col1) from t2 order by col2 desc limit 5; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1000 Using filesort +ReplayTest: Query error: FUNCTION test.f1 does not exist set @counter=0; select f1(col1) from t2 order by col2 desc limit 5; f1(col1) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.sp/' main.partition_not_blackhole [ pass ] 8 main.partition_example [ pass ] 32 main.partition_not_windows [ pass ] 42 main.assign_key_cache [ pass ] 30 main.auto_increment_ranges_myisam [ pass ] 35 ReplayTest: Loading context ReplayTest: Loading context main.column_compression_parts [ pass ] 99 main.ctype_partitions [ pass ] 18 main.ctype_uca_partitions [ pass ] 20 main.drop_bad_db_type [ pass ] 23 main.enforce_storage_engine [ pass ] 33 ReplayTest: Loading context ReplayTest: Loading context main.explain_json_format_partitions [ pass ] 27 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: explain insert into t1 values (1),(2),(3) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.explain_non_select [ fail ] Test ended at 2026-04-23 23:10:26 CURRENT_TEST: main.explain_non_select --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_non_select.result 2026-04-17 18:40:40.396796029 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_non_select.reject 2026-04-23 23:10:26.404848245 +0300 @@ -13,7 +13,7 @@ # DELETE without WHERE is a special case: explain delete from t0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL 8 Deleting all rows +1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows create table t1 (a int, b int, filler char(100), key(a), key(b)); insert into t1 select A.a+10*B.a + 10*C.a, A.a+10*B.a + 10*C.a, 'filler' @@ -37,8 +37,7 @@ # Try some subqueries: explain delete from t1 where a < (select max(a) from t0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range a a 5 NULL 1 Using where -2 SUBQUERY t0 ALL NULL NULL NULL NULL 8 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain delete from t1 where a < (select max(a) from t0 where a < t1.b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 512 Using where @@ -88,8 +87,7 @@ # Try some subqueries: explain update t1 set filler='fooo' where a < (select max(a) from t0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range a a 5 NULL 1 Using where -2 SUBQUERY t0 ALL NULL NULL NULL NULL 8 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain update t1 set filler='fooo' where a < (select max(a) from t0 where a < t1.b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 512 Using where @@ -125,7 +123,7 @@ 1 SIMPLE t0 ALL NULL NULL NULL NULL 8 explain replace into t1 select * from t0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL 8 +1 SIMPLE t0 system NULL NULL NULL NULL 0 Const row not found drop table t0, t1; # # MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain @@ -190,8 +188,7 @@ # create table t1 (a int, key(a)); explain insert into t1 values (1),(2),(3); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 insert into t1 values (1),(2),(3); create table t2 (a int, b int); explain insert into t2 values @@ -199,8 +196,8 @@ (11, 1+(select max(a+1) from t1)); id select_type table type possible_keys key key_len ref rows Extra 1 INSERT t2 ALL NULL NULL NULL NULL NULL NULL -3 SUBQUERY t1 index NULL a 5 NULL 3 Using index -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +3 SUBQUERY t1 system NULL NULL NULL NULL 0 Const row not found +2 SUBQUERY t1 system NULL NULL NULL NULL 0 Const row not found drop table t1,t2; # # MDEV-5122: "Commands out of sync", "Malformed packet" or client hang up on unique key violation Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.explain_non_select/' main.huge_frm-6224 [ pass ] 2265 main.identifier_partition [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.ignored_index [ pass ] 193 main.information_schema_part [ pass ] 36 main.lock [ pass ] 74 ReplayTest: Loading context main.long_unique [ pass ] 187 main.partition_bug18198 [ pass ] 21 main.partition_cache_myisam [ pass ] 819 main.partition_charset [ pass ] 23 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.partition_column [ fail ] Test ended at 2026-04-23 23:10:32 CURRENT_TEST: main.partition_column --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_column.result 2026-04-17 18:40:40.463800169 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_column.reject 2026-04-23 23:10:32.456851833 +0300 @@ -98,7 +98,7 @@ 00410000 explain partitions select hex(a) from t1 where a like 'A_'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 system NULL NULL NULL NULL 1 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 remove partitioning; select hex(a) from t1 where a like 'A_'; hex(a) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_column/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.partition_column_prune [ pass ] 116 main.partition_csv [ pass ] 17 main.partition_datatype_32 [ skipped ] Need a 32 bit timestamps main.partition_datatype_64 [ pass ] 33 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_default [ pass ] 313 main.partition_error [ pass ] 156 main.partition_grant [ pass ] 24 ReplayTest: Loading context ReplayTest: Loading context 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.partition_hash [ pass ] 80 main.partition_key_cache [ pass ] 269 ReplayTest: Loading context ReplayTest: Loading context main.partition_list [ pass ] 70 main.partition_mgm [ pass ] 29 main.partition_mgm_err [ pass ] 44 main.partition_mgm_err2 [ pass ] 28 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.partition_mrr_aria [ fail ] Test ended at 2026-04-23 23:10:36 CURRENT_TEST: main.partition_mrr_aria --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_aria.result 2026-04-02 14:38:09.430657448 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_aria.reject 2026-04-23 23:10:36.722855158 +0300 @@ -44,7 +44,7 @@ explain select * from t3 force index (key_col) where key_col < 3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range key_col key_col 5 NULL # Using index condition; Rowid-ordered scan +1 SIMPLE t3 range key_col key_col 5 NULL # Using index condition select * from t3 force index (key_col) where key_col < 3; ID part_id key_col col2 1 0 0 123456 @@ -130,7 +130,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; @@ -164,7 +164,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_mrr_aria/' ReplayTest: Loading context 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.partition_mrr_myisam [ fail ] Test ended at 2026-04-23 23:10:37 CURRENT_TEST: main.partition_mrr_myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_myisam.result 2026-04-02 14:38:09.430657448 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_mrr_myisam.reject 2026-04-23 23:10:37.306855664 +0300 @@ -44,7 +44,7 @@ explain select * from t3 force index (key_col) where key_col < 3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 range key_col key_col 5 NULL # Using index condition; Rowid-ordered scan +1 SIMPLE t3 range key_col key_col 5 NULL # Using index condition select * from t3 force index (key_col) where key_col < 3; ID part_id key_col col2 1 0 0 123456 @@ -130,7 +130,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1; @@ -164,7 +164,7 @@ explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index -1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t0 ALL idx NULL NULL NULL 50 24.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4 select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_mrr_myisam/' main.partition_myisam [ pass ] 1082 ReplayTest: Loading context main.partition_order [ pass ] 85 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.partition_pruning [ pass ] 2521 main.partition_rename_longfilename [ pass ] 18 main.partition_sp [ pass ] 14 main.partition_symlink [ pass ] 53 main.partition_sync [ pass ] 44 main.partition_truncate [ pass ] 20 main.partition_ucs2 [ pass ] 17 main.partition_utf8 [ pass ] 15 main.partition_utf8-debug [ pass ] 24 main.partition_windows [ skipped ] Need windows main.ps_mem_leaks [ pass ] 70 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sargable_casefold_part [ pass ] 21 main.stat_tables_partition [ pass ] 24 main.vector_partition [ pass ] 15 main.mysql_client_test_comp [ pass ] 35257 main.ssl_7937 'x509v3' [ pass ] 156 main.ssl_verify_ip [ pass ] 51 main.ssl_7937 'ssl' [ pass ] 184 main.failed_auth_unixsocket [ pass ] 1047 main.password_expiration_unix_socket [ pass ] 65 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_misc [ pass ] 2822 main.plugin_load [ pass ] 11 main.plugin_load_option [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.index_merge_myisam [ fail ] Test ended at 2026-04-23 23:12:15 CURRENT_TEST: main.index_merge_myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_myisam.result 2026-04-02 14:38:09.374657600 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_merge_myisam.reject 2026-04-23 23:12:15.210072300 +0300 @@ -587,7 +587,9 @@ SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%' ORDER BY a,b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge a,b a,b 131,131 NULL 64 Using sort_union(a,b); Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 464. SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%' ORDER BY a,b; SET SESSION sort_buffer_size=DEFAULT; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.index_merge_myisam/' main.analyze_format_json [ pass ] 2049 main.ctype_utf8mb4_0900_ai_ci_casefold [ pass ] 2075 main.ctype_utf8mb4_general1400_as_ci_casefold [ pass ] 2043 main.ctype_utf8mb4_general_ci_casefold [ pass ] 2016 main.ctype_utf8mb4_general_ci_ws [ pass ] 1809 main.ctype_utf8mb4_turkish_ci_casefold [ pass ] 2048 main.ctype_utf8mb4_uca1400_ai_ci_casefold [ pass ] 2055 main.ctype_utf8mb4_unicode_520_ci_casefold [ pass ] 2054 main.ctype_utf8mb4_unicode_ci_casefold [ pass ] 2057 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.order_by [ fail ] Test ended at 2026-04-23 23:13:00 CURRENT_TEST: main.order_by --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by.result 2026-04-17 18:40:40.461800046 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by.reject 2026-04-23 23:13:00.530234309 +0300 @@ -884,7 +884,9 @@ ('25295','02071491000'),('25296','02071491000'),('25297','02071499000'); explain select * from t1 where wnid like '0101%' order by wnid; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range wnid14,wnid wnid 13 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1033. select * from t1 where wnid like '0101%' order by wnid; sid wnid 10100 01019000000 @@ -1195,7 +1197,7 @@ 1 SIMPLE t2 index k2 k3 5 NULL 111 Using where EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range k2 k2 5 NULL 7341 Using index condition; Using filesort +1 SIMPLE t2 ALL k2 NULL NULL NULL 40960 Using where; Using filesort EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 6000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL k2 NULL NULL NULL 40960 Using where; Using filesort @@ -3760,8 +3762,9 @@ explain extended select * from t4 where b < 5000 order by a limit 600; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t4 index NULL a 5 NULL 1188 100.00 Using where +1 SIMPLE t4 index NULL a 5 NULL 611 100.00 Using where Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t4 with key_number: doesn't exist in list_index_read_costs Note 1003 select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t4`.`c` AS `c`,`test`.`t4`.`filler1` AS `filler1`,`test`.`t4`.`filler2` AS `filler2` from `test`.`t4` where `test`.`t4`.`b` < 5000 order by `test`.`t4`.`a` limit 600 set histogram_size=@tmp_h, histogram_type=@tmp_ht, use_stat_tables=@tmp_u, optimizer_use_condition_selectivity=@tmp_o; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.order_by/' ***Warnings generated in error logs during shutdown after running tests: main.ctype_utf8mb4_0900_ai_ci_casefold main.ctype_utf8mb4_turkish_ci_casefold main.ctype_utf8mb4_general_ci_ws main.analyze_format_json main.ctype_utf8mb4_unicode_ci_casefold main.ctype_utf8mb4_unicode_520_ci_casefold main.ctype_utf8mb4_general_ci_casefold main.order_by main.ctype_utf8mb4_uca1400_ai_ci_casefold main.ctype_utf8mb4_general1400_as_ci_casefold 2026-04-23 23:12:59 41 [ERROR] mariadbd: Out of sort memory, consider increasing server sort buffer size ReplayTest: Loading context main.rowid_filter_myisam_debug [ pass ] 72 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 [ fail ] Test ended at 2026-04-23 23:13:04 CURRENT_TEST: main.subselect_mat --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat.result 2026-04-02 14:38:09.483657304 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat.reject 2026-04-23 23:13:04.344249128 +0300 @@ -531,7 +531,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = '2 - 01' or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = convert('1 - 01' using latin1) or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = convert('2 - 01' using latin1) or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); a1 a2 1 - 01 2 - 01 @@ -541,7 +541,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = '2 - 01' or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = convert('1 - 01' using latin1) or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = convert('2 - 01' using latin1) or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual); a1 a2 1 - 01 2 - 01 @@ -689,9 +689,9 @@ where a1 in (select group_concat(b1) from t2_16 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,`test`.`t1_16`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` ), (`test`.`t1_16`.`a1` in on distinct_key where `test`.`t1_16`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having (`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -787,9 +787,9 @@ where a1 in (select group_concat(b1) from t2_512 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where `test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` having (`test`.`t1_512`.`a1`) = (group_concat(`test`.`t2_512`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -804,9 +804,9 @@ where a1 in (select group_concat(b1) from t2_512 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,`test`.`t1_512`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` ), (`test`.`t1_512`.`a1` in on distinct_key where `test`.`t1_512`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` having (`test`.`t1_512`.`a1`) = (group_concat(`test`.`t2_512`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -888,9 +888,9 @@ where a1 in (select group_concat(b1) from t2_1024 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` having (`test`.`t1_1024`.`a1`) = (group_concat(`test`.`t2_1024`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -906,9 +906,9 @@ where a1 in (select group_concat(b1) from t2_1024 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,`test`.`t1_1024`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` ), (`test`.`t1_1024`.`a1` in on distinct_key where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` having (`test`.`t1_1024`.`a1`) = (group_concat(`test`.`t2_1024`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -991,9 +991,9 @@ where a1 in (select group_concat(b1) from t2_1025 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` having (`test`.`t1_1025`.`a1`) = (group_concat(`test`.`t2_1025`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -1009,9 +1009,9 @@ where a1 in (select group_concat(b1) from t2_1025 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,`test`.`t1_1025`.`a1` in ( (/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` ), (`test`.`t1_1025`.`a1` in on distinct_key where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)`)))) +Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` having (`test`.`t1_1025`.`a1`) = (group_concat(`test`.`t2_1025`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -2002,8 +2002,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 index NULL c 5 NULL 8 Using where; Using index -2 MATERIALIZED s2 ref d d 4 const 2 Using where; Using index -2 MATERIALIZED s1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 SUBQUERY t2 ALL NULL NULL NULL NULL 8 SELECT a, c FROM t1, t2 WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 @@ -2021,8 +2020,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 index NULL c 5 NULL 8 Using where; Using index -2 MATERIALIZED s2 ref d d 4 const 2 Using where; Using index -2 MATERIALIZED s1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 SUBQUERY t2 ALL NULL NULL NULL NULL 8 SELECT a, c FROM t1, t2 WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 @@ -2570,13 +2568,7 @@ explain extended select * from t1 left join t4 on t1.b = t4.id where f1(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f1`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f1 does not exist # Non-deterministic function in left part of IN subq: semi-join is OK select * from t1 left join t4 on t1.b = t4.id @@ -2588,13 +2580,7 @@ explain extended select * from t1 left join t4 on t1.b = t4.id where f2(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f2`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f2 does not exist select t1.*, t4.*, (select max(t4.id) from t4 where t4.id=t1.b and sleep(0) = 0) as s from t1 left join t4 on t1.b = t4.id @@ -2607,15 +2593,7 @@ (select max(t4.id) from t4 where t4.id=t1.b and sleep(0) = 0) as s from t1 left join t4 on t1.b = t4.id where f2(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.t1.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a`,(/* select#2 */ select max(`test`.`t4`.`id`) from `test`.`t4` where `test`.`t4`.`id` = `test`.`t1`.`b` and sleep(0) = 0) AS `s` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f2`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f2 does not exist drop function f1; drop function f2; drop table t1,t2,t3,t4; @@ -2920,7 +2898,7 @@ EXPLAIN SELECT * FROM t2 WHERE (SELECT f3a FROM t3) NOT IN (SELECT f1a FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t2 WHERE (SELECT f3a FROM t3) NOT IN (SELECT f1a FROM t1); @@ -2937,7 +2915,7 @@ EXPLAIN SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat/' ReplayTest: Loading context main.opt_context_replay_basic [ fail ] Test ended at 2026-04-23 23:13:05 CURRENT_TEST: main.opt_context_replay_basic mysqltest: At line 68: query 'EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a = 1' failed: ER_NO_SUCH_TABLE (1146): Table 'db1.t1' doesn't exist The result from queries just before the failure was: < snip > "possible_keys": ["a"], "key": "a", "key_length": "5", "used_key_parts": ["a"], "ref": ["const"], "loops": 1, "rows": 1, "cost": 0.002024411, "filtered": 100 } } ] } } select context into dumpfile "../../tmp/dump1.sql" from information_schema.optimizer_context; drop table t1; set optimizer_replay_context='opt_context'; # Same query as above, must have same explain: EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a = 1; More results from queries before failure can be found in /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/opt_context_replay_basic.log - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_context_replay_basic/' main.multi_update_big [ pass ] 14384 ReplayTest: Loading context main.error_simulation [ pass ] 54 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_notembedded [ fail ] Test ended at 2026-04-23 23:13:36 CURRENT_TEST: main.selectivity_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_notembedded.result 2026-04-02 14:38:09.455657380 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_notembedded.reject 2026-04-23 23:13:36.080378192 +0300 @@ -71,16 +71,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; @@ -124,7 +115,7 @@ "loops": 1, "rows": 100, "cost": 0.0295225, - "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" } } @@ -136,14 +127,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col0", - "ranges": - ["1 < col0"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL $query_tbl; EXPLAIN { @@ -158,7 +142,7 @@ "loops": 1, "rows": 100, "cost": 0.0295225, - "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" } } @@ -170,14 +154,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. @@ -199,7 +176,7 @@ "loops": 1, "rows": 100, "cost": 0.0295225, - "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" } } @@ -211,16 +188,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; # @@ -257,14 +225,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 @@ -273,7 +234,7 @@ JS [ { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -281,22 +242,21 @@ "considered_access_paths": [ { - "access_type": "range", - "range_index": "PRIMARY", - "rows": 5, - "rows_after_filter": 5, - "rows_out": 2.490196078, - "cost": 0.010014472, + "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.010014472, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_notembedded/' main.stat_tables_myisam_debug [ pass ] 48 main.analyze_format_json_timings [ pass ] 114 main.order_by_pack_big [ pass ] 15448 ReplayTest: Loading context ReplayTest: Loading context 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.bool [ pass ] 49 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.cset_narrowing [ fail ] Test ended at 2026-04-23 23:14:09 CURRENT_TEST: main.cset_narrowing --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cset_narrowing.result 2026-04-17 18:40:40.369794361 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cset_narrowing.reject 2026-04-23 23:14:09.351522755 +0300 @@ -242,28 +242,15 @@ explain select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 ref mb3 mb3 99 const 3 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 401. select json_detailed(json_extract(trace, '$**.range_scan_alternatives')) as JS from information_schema.optimizer_trace; JS -[ - [ - { - "index": "mb3", - "ranges": - ["(�) <= (mb3) <= (�)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 3, - "cost": "COST_REPLACED", - "chosen": true - } - ] -] +NULL select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3; pk mb4name mb4 mb3name mb3 3 mb4-smiley 😊 mb3-replacement-char � @@ -276,39 +263,13 @@ { "query_block": { "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t10", - "access_type": "const", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["pk"], - "ref": ["const"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "range", - "possible_keys": ["mb3"], - "key": "mb3", - "key_length": "99", - "used_key_parts": ["mb3"], - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t1.mb3 = '????' or t1.mb3 = 'hello'" - } - } - ] + "table": { + "message": "Impossible WHERE noticed after reading const tables" + } } } +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 432. explain format=json select * from t10, t1 where t1.mb3>t10.mb4 and t10.pk=3; EXPLAIN @@ -381,7 +342,7 @@ "key_length": "131", "used_key_parts": ["mb4"], "loops": 1, - "rows": 3, + "rows": 1, "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.mb4 > '????'" @@ -390,6 +351,8 @@ ] } } +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(????) < (mb4), ] doesn't exist in the list of ranges for table_name test.t2 and index_name mb4 # # Check multiple equalities # @@ -454,27 +417,7 @@ select json_detailed(json_extract(trace, '$**.condition_processing')) as JS from information_schema.optimizer_trace; JS -[ - { - "condition": "WHERE", - "original_condition": "t1.mb3 = t2.mb4 and t2.mb4 = t10.mb4 and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe'", - "steps": - [ - { - "transformation": "equality_propagation", - "resulting_condition": "concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - } - ] - } -] +NULL select straight_join * from t10,t1 force index(mb3),t2 where t1.mb3=t2.mb4 and t2.mb4=t10.mb4 and concat(t1.mb3, t2.mb4, t10.mb4)<>'Bebebe'; @@ -545,27 +488,7 @@ select json_detailed(json_extract(trace, '$**.condition_processing')) as JS from information_schema.optimizer_trace; JS -[ - { - "condition": "WHERE", - "original_condition": "t1.mb3 = t2.mb4 and t2.mb4 = t10.mb4 and t10.mb4 = 'hello' and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe'", - "steps": - [ - { - "transformation": "equality_propagation", - "resulting_condition": "t10.mb4 = 'hello' and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "t10.mb4 = 'hello' and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "t10.mb4 = 'hello' and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe' and multiple equal(t1.mb3, t2.mb4, t10.mb4)" - } - ] - } -] +NULL drop table t2; drop table t1, t10; set optimizer_switch=@tmp_csetn_os; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.cset_narrowing/' main.ctype_ucs2_general_ci_casefold [ pass ] 689 main.ctype_ucs2_general_ci_ws [ pass ] 233 main.ctype_ucs2_general_mysql500_ci_casefold [ pass ] 678 main.ctype_ucs2_general_mysql500_ci_ws [ pass ] 260 main.ctype_ucs2_turkish_ci_casefold [ pass ] 701 main.ctype_ucs2_unicode_520_ci_casefold [ pass ] 740 main.ctype_utf8mb3_general_ci_casefold [ pass ] 705 main.ctype_utf8mb3_general_ci_ws [ pass ] 209 main.ctype_utf8mb3_general_mysql500_ci_casefold [ pass ] 696 main.ctype_utf8mb3_general_mysql500_ci_ws [ pass ] 221 main.ctype_utf8mb3_turkish_ci_casefold [ pass ] 774 main.ctype_utf8mb3_unicode_520_ci_casefold [ pass ] 734 main.ctype_utf8mb4_general1400_as_ci_ws [ pass ] 3631 main.delete_returning [ pass ] 24 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived.test" ReplayTest: At line 1956 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.derived [ fail ] Test ended at 2026-04-23 23:14:37 CURRENT_TEST: main.derived --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived.result 2026-04-17 18:40:40.385795349 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived.reject 2026-04-23 23:14:37.482521222 +0300 @@ -3360,51 +3360,6 @@ create view v9 as select * from (select c1, f1(c2), sum(c3) from t1 group by c1, f1(c2)) as f (c1, c2, c3); explain format=json select * from v9 where (c3+1) > 10 and c1 > 1 and c2 > 123; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 0.010089369, - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": 0.010089369, - "filtered": 100, - "attached_condition": "f.c3 + 1 > 10 and f.c1 > 1 and f.c2 > 123", - "materialized": { - "query_block": { - "select_id": 3, - "cost": 0.011611947, - "having_condition": "c3 + 1 > 10 and c2 > 123", - "filesort": { - "sort_key": "t1.c1, f1(t1.c2)", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": 0.01034841, - "filtered": 100, - "attached_condition": "t1.c1 > 1" - } - } - ] - } - } - } - } - } - } - ] - } -} drop function f1; # name resolution for multi select units select a1 from Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.derived/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1254 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1274 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1308 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1323 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1340 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1355 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1370 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1387 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1406 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1590 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1599 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1608 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1617 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1635 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1658 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1677 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1730 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1732 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1746 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1748 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1789 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1791 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1808 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1810 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1827 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1829 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1846 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1848 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1887 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1900 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1912 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1924 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1953 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 1965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2068 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2078 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2114 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2127 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2140 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2153 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2191 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2193 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2206 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2227 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2236 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2272 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2336 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2363 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2370 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2413 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2441 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2454 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2497 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2499 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2507 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2509 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2516 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2518 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2535 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2537 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2547 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2556 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2558 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2570 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2572 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2602 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2604 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2620 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2622 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2630 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2632 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2639 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2641 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2648 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2650 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2658 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2660 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2679 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2681 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2694 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2696 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2726 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2728 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2747 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2749 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2768 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2770 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2789 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2791 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2810 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2812 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2831 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2833 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2852 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2854 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2876 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2878 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2899 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2901 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2922 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2924 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2941 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2943 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2962 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 2983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3003 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3005 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3027 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3046 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3048 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3065 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3067 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3104 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3121 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3130 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3132 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3149 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3151 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3166 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3179 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3181 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3194 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3196 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3244 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3259 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3261 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3277 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3279 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3307 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3309 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3322 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3333 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3335 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3346 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3348 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3370 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3372 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3381 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3383 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3396 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3407 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3409 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3444 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3446 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3524 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3556 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3578 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3598 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3634 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3672 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3707 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3716 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3808 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3810 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3814 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3816 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3917 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3919 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 3924 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4026 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4028 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4032 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4059 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4061 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4065 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4141 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4166 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4167 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4204 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4212 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.test" ReplayTest: At line 4303 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.derived_cond_pushdown [ fail ] Test ended at 2026-04-23 23:14:47 CURRENT_TEST: main.derived_cond_pushdown --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.result 2026-04-17 18:40:40.390795658 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_cond_pushdown.reject 2026-04-23 23:14:47.028665827 +0300 @@ -9711,7 +9711,7 @@ "rows": 2, "cost": "COST_REPLACED", "filtered": 100, - "attached_condition": "v1.b = 2", + "attached_condition": "v1.b = 0", "materialized": { "query_block": { "select_id": 3, @@ -9725,7 +9725,7 @@ "rows": 2, "cost": "COST_REPLACED", "filtered": 100, - "attached_condition": "t1.b = 2" + "attached_condition": "t1.b = 0" } } ] @@ -9753,103 +9753,7 @@ EXPLAIN FORMAT=JSON SELECT * FROM v AS v1, v AS v2 WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.f = 2", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.f = 2" - } - } - ] - } - } - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 2, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.pk > 2" - }, - "buffer_type": "flat", - "buffer_size": "119", - "join_type": "BNL", - "materialized": { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t", - "access_type": "range", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["pk"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t.pk > 2" - } - } - ] - } - } - } - } - ] - } -} +ReplayTest: Query error: Lost connection to server during query DROP VIEW v; DROP TABLE t; # @@ -9866,64 +9770,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = 3", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = 3" - } - } - ] - } - } - } - } - ] - } -} UPDATE t2 SET j = 2 WHERE j = 3; SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -9941,64 +9787,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = 2.71", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = 2.7100000381469727" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; CREATE TABLE t1 (i DECIMAL(10,2)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1.5),(3.21),(2.47); @@ -10011,64 +9799,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = 3.21", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = 3.21" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; CREATE TABLE t1 (i VARCHAR(32)) ENGINE=MyISAM; INSERT INTO t1 VALUES ('cc'),('aa'),('ddd'); @@ -10081,64 +9811,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = 'aa'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = 'aa'" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; CREATE TABLE t1 (i DATETIME) ENGINE=MyISAM; INSERT INTO t1 VALUES @@ -10153,64 +9825,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = '2007-05-28 00:00:00'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; CREATE TABLE t1 (i DATE) ENGINE=MyISAM; INSERT INTO t1 VALUES ('2008-09-27'),('2007-05-28'), ('2009-07-25'); @@ -10223,64 +9837,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = '2007-05-28'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = DATE'2007-05-28'" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; CREATE TABLE t1 (i TIME) ENGINE=MyISAM; INSERT INTO t1 VALUES ('00:34:58'),('10:00:02'), ('09:21:20'); @@ -10293,64 +9849,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "system", - "rows": 0, - "filtered": 0, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "table": { - "message": "Select tables optimized away" - } - } - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "sq.i = '10:00:02'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.i = TIME'10:00:02'" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; # # MDEV-11593: pushdown of condition with NULLIF @@ -10363,45 +9861,6 @@ 2 EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE NULLIF(1, i); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nullif(1,v1.i)", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nullif(1,t1.i)" - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v1; DROP TABLE t1; # @@ -10416,27 +9875,6 @@ c EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE v1.c IN ( SELECT MIN(c) FROM t2 WHERE 0 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - }, - "subqueries": [ - { - "materialization": { - "query_block": { - "select_id": 2, - "table": { - "message": "Impossible WHERE" - } - } - } - } - ] - } -} DROP VIEW v1; DROP TABLE t1,t2; CREATE TABLE t1 (d DECIMAL(10,2)); @@ -10721,65 +10159,6 @@ explain format=json select b from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t where b > 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 2 and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t1.a"], - "loops": 7, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t2.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b > 2" - } - } - ] - } - } - } - } - } - } - ] - } -} select a from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t where a > 2; @@ -10789,65 +10168,6 @@ explain format=json select a from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t where a > 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 2 and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t1.a"], - "loops": 7, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t2.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b > 2" - } - } - ] - } - } - } - } - } - } - ] - } -} select a from ( select t1.a, v2.b, v2.c from t1, v2 where t1.a = v2.b ) as t where a > 2; @@ -10860,62 +10180,6 @@ explain format=json select a from ( select t1.a, v2.b, v2.c from t1, v2 where t1.a = v2.b ) as t where a > 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 2 and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t1.a"], - "loops": 7, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b > 2" - } - } - ] - } - } - } - } - } - ] - } -} select a from ( select t1.a, v3.b, v3.m from t1, v3 where t1.a = v3.m ) as t where a > 2; @@ -10925,65 +10189,6 @@ explain format=json select a from ( select t1.a, v3.b, v3.m from t1, v3 where t1.a = v3.m ) as t where a > 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 2 and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["m"], - "ref": ["test.t1.a"], - "loops": 7, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "m > 2", - "filesort": { - "sort_key": "t2.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} drop view v1,v2,v3; drop table t1,t2; # @@ -10996,45 +10201,6 @@ f 2 explain format=json SELECT * FROM ( SELECT * FROM v1 ) AS sq WHERE f > 0; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.f > 0", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "f > 0", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v1; DROP TABLE t1; # @@ -11050,66 +10216,6 @@ i1 i2 explain format=json SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["i1"], - "key": "i1", - "key_length": "5", - "used_key_parts": ["i1"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.i2 = 1" - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.i2 = 1" - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v2; DROP TABLE t1,t2; # @@ -11126,46 +10232,6 @@ explain format=json select * from ( select distinct regexp_substr(t1.a,'^[A-Za-z]+') as f from t1) as t where t.f = 'a' or t.f = 'b'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.f = 'a' or t.f = 'b'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - ] - } -} drop table t1; # # MDEV-13454: consequence of mdev-14368 fixed for 5.5 @@ -11187,66 +10253,6 @@ LEFT OUTER JOIN (SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2) WHERE (vc.ct>0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.id2 is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["id2"], - "ref": ["test.t1.id2"], - "loops": 4, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "vc.ct > 0", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "ct > 0", - "filesort": { - "sort_key": "t2.id2", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} DROP TABLE t1,t2; SET sql_mode = DEFAULT; # @@ -11280,10 +10286,6 @@ ) AS v1 WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.a=t2.x) AND (v1.max_c>30); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where EXPLAIN FORMAT=JSON SELECT * FROM t2, ( @@ -11294,62 +10296,6 @@ ) AS v1 WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.a=t2.x) AND (v1.max_c>30); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x = 1" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 2, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 1 and v1.b = 1 and v1.max_c > 30" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "max_c > 37 and max_c > 30", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1 and t1.b = 1" - } - } - ] - } - } - } - } - ] - } -} SELECT * FROM t2, ( @@ -11373,10 +10319,6 @@ ) AS v1 WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.b=v1.d) AND (v1.a=t2.x) AND (v1.max_c>30); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where EXPLAIN FORMAT=JSON SELECT * FROM t2, ( @@ -11387,62 +10329,6 @@ ) AS v1 WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.b=v1.d) AND (v1.a=t2.x) AND (v1.max_c>30); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x = 1" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 2, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 1 and v1.b = 1 and v1.d = 1 and v1.max_c > 30" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "max_c > 37 and max_c > 30", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1 and t1.b = 1 and t1.d = 1" - } - } - ] - } - } - } - } - ] - } -} DROP TABLE t1,t2; # # MDEV-15765: pushing condition with temporal constants @@ -11495,10 +10381,6 @@ WHERE d_tab.e>1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where -1 PRIMARY eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1 -3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11512,66 +10394,6 @@ WHERE d_tab.e>1 ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "10", - "used_key_parts": ["e", "max_f"], - "ref": ["test.t1.a", "test.t1.b"], - "loops": 5, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_f > 18", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e > 1" - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11601,10 +10423,6 @@ WHERE d_tab.max_f<25 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where -1 PRIMARY eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1 -3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11618,65 +10436,6 @@ WHERE d_tab.max_f<25 ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b < 25 and t1.a is not null and t1.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "10", - "used_key_parts": ["e", "max_f"], - "ref": ["test.t1.a", "test.t1.b"], - "loops": 5, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_f > 18 and max_f < 25", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11705,11 +10464,6 @@ GROUP BY d_tab.g ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 5 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11723,89 +10477,6 @@ GROUP BY d_tab.g ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a is not null and t1.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["e", "max_f"], - "ref": ["test.t1.a", "test.t1.b"], - "loops": 5, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e > 1" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11834,11 +10505,6 @@ GROUP BY d_tab.g ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 5 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a,t1.b) IN ( @@ -11852,89 +10518,6 @@ GROUP BY d_tab.g ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a is not null and t1.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["e", "max_f"], - "ref": ["test.t1.a", "test.t1.b"], - "loops": 5, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.max_f > 20", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_f > 20", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} DROP TABLE t1,t2; # # MDEV-15765: pushing condition with IN subquery defined with constants @@ -11973,50 +10556,6 @@ GROUP BY t1.a ) dt WHERE (dt.a=2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "dt.a = 2", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "a = 2", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( SELECT t1.b AS a @@ -12036,51 +10575,6 @@ HAVING (t1.a<3) ) dt WHERE (dt.a>1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "dt.a > 1", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "a > 1", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 3" - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( SELECT 'ab' AS a @@ -12099,49 +10593,6 @@ GROUP BY t1.a ) dt WHERE (dt.a='ab'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "dt.a = 'ab'", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( SELECT 1 AS a @@ -12160,49 +10611,6 @@ GROUP BY t1.a ) dt WHERE (dt.a=1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "dt.a = 1", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} DROP TABLE t1; # # MDEV-16517: pushdown condition with the IN predicate defined @@ -12241,65 +10649,6 @@ WHERE 1 IN (0,t1.a) ) AS dt2 ON dt1.a = dt2.a; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "1 in (0,t1.a) and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)" - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( SELECT t1.a,MAX(t1.b) @@ -12317,65 +10666,6 @@ GROUP BY t1.a ) AS dt, t1 WHERE dt.a=t1.a AND dt.a IN (1,t1.a); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a in (1,t1.a) and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a in (1,t1.a)" - } - } - ] - } - } - } - } - } - } - ] - } -} DROP TABLE t1; # # MDEV-15087: error from inexpensive subquery before check @@ -12456,50 +10746,6 @@ CREATE TABLE t3 (a int, b int) ENGINE MYISAM; EXPLAIN FORMAT=JSON INSERT INTO t3 SELECT * FROM (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE a<=2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a <= 2", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a <= 2" - } - } - ] - } - } - } - } - } - } - ] - } -} INSERT INTO t3 SELECT * FROM (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE a<=2; SELECT * FROM t3; @@ -12508,66 +10754,6 @@ 2 2 EXPLAIN FORMAT=JSON UPDATE t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t SET t2.a=t.c+10 WHERE t2.a= t.c and t.a>=3; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "8", - "used_key_parts": ["c"], - "ref": ["test.t2.a"], - "loops": 5, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a = t.c and t.a >= 3", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a >= 3" - } - } - ] - } - } - } - } - } - } - ] - } -} UPDATE t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t SET t2.a=t.c+10 WHERE t2.a= t.c and t.a>=3; SELECT * FROM t2; @@ -12579,55 +10765,6 @@ 11 EXPLAIN FORMAT=JSON DELETE t2 FROM t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE t2.a= t.c+9 and t.a=2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 5, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a = 2 and t2.a = t.c + 9", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 2" - } - } - ] - } - } - } - } - ] - } -} DELETE t2 FROM t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE t2.a= t.c+9 and t.a=2; SELECT * FROM t2; @@ -12661,50 +10798,6 @@ FROM (SELECT MAX(a) as max_a,b FROM t1 GROUP BY t1.b) AS tab2 ) AS tab1 WHERE (tab1.max_a=1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "case when tab2.max_a = 1 or tab2.max_a = 2 then 1 else 0 end = 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "case when max_a = 1 or max_a = 2 then 1 else 0 end = 1", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( @@ -12724,50 +10817,6 @@ FROM (SELECT MAX(a) as max_a,b FROM t1 GROUP BY t1.b) AS tab2 ) AS tab1 WHERE (tab1.max_a=1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "case when tab2.max_a = 1 or tab2.max_a > 2 and tab2.max_a < 4 then 1 else 0 end = 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "case when max_a = 1 or max_a > 2 and max_a < 4 then 1 else 0 end = 1", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( @@ -12787,50 +10836,6 @@ FROM (SELECT MAX(a) as max_a,b FROM t1 GROUP BY t1.b) AS tab2 ) AS tab1 WHERE (tab1.max_a=1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "case when tab2.max_a > 1 and (tab2.max_a = 2 or tab2.max_a > 2) then 1 else 0 end = 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "case when max_a > 1 and (max_a = 2 or max_a > 2) then 1 else 0 end = 1", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM ( @@ -12850,50 +10855,6 @@ FROM (SELECT MAX(a) as max_a,b FROM t1 GROUP BY t1.b) AS tab2 ) AS tab1 WHERE (tab1.max_a=1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "case when tab2.b = 2 or tab2.b = 4 then 1 else 0 end = 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "case when t1.b = 2 or t1.b = 4 then 1 else 0 end = 1" - } - } - ] - } - } - } - } - } - } - ] - } -} DROP TABLE t1; # # MDEV-16803: pushdown condition with IN predicate in the derived table @@ -12926,67 +10887,8 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL; EXPLAIN INSERT INTO t1 SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 12 Using temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) -4 DERIVED t1 ALL NULL NULL NULL NULL 12 EXPLAIN FORMAT=JSON INSERT INTO t1 SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 12, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f is not null" - }, - "buffer_type": "flat", - "buffer_size": "64", - "join_type": "BNL" - } - } - ] - } - } -} SELECT * FROM t1; f 3 @@ -13009,62 +10911,6 @@ EXPLAIN FORMAT=JSON INSERT INTO t1 SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t WHERE f IS NOT NULL; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "4", - "used_key_parts": ["f"], - "ref": ["test.t1.f"], - "loops": 8, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f is not null" - } - } - ] - } - } - } - } - ] - } - } -} SELECT * FROM t1; f 3 @@ -13088,65 +10934,6 @@ CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 GROUP BY f2) AS t; UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f2 < 2 and t1.f2 is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["f2"], - "ref": ["test.t1.f2"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.f2", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f2 < 2" - } - } - ] - } - } - } - } - } - } - ] - } -} SELECT * FROM t1; f1 f2 z 1 @@ -13156,62 +10943,6 @@ f2 f1 f2 1 z 1 EXPLAIN FORMAT=JSON SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f2 < 2 and t1.f2 is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["f2"], - "ref": ["test.t1.f2"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f2 < 2" - } - } - ] - } - } - } - } - } - ] - } -} DROP VIEW v1,v2; DROP TABLE t1; # @@ -13244,52 +10975,6 @@ 1 EXPLAIN FORMAT=JSON SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "table": { - "message": "no matching row in const table" - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "table": { - "message": "no matching row in const table" - } - } - } - ] - } - } - } - } - } - ] - } -} DROP TABLE t1; DROP VIEW v1; # @@ -13349,12 +11034,6 @@ explain extended select * from (select min(a) as x from t1 union all select max(a) as y from t1) t where x>0; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 6 100.00 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 -3 UNION t1 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 /* select#1 */ select `t`.`x` AS `x` from (/* select#2 */ select min(`test`.`t1`.`a`) AS `x` from `test`.`t1` having `x` > 0 union all /* select#3 */ select max(`test`.`t1`.`a`) AS `x` from `test`.`t1` having `x` > 0) `t` where `t`.`x` > 0 prepare stmt from "select * from (select min(a) as x from t1 union all select max(a) as y from t1) t where x>0"; @@ -13392,11 +11071,6 @@ 1 1 1 3 3 3 explain extended select * from (select * from v1) as dt where a=f and a=g; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 7 100.00 Using where -3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `v1`.`a` AS `a`,`v1`.`f` AS `f`,`v1`.`g` AS `g` from `test`.`v1` where `v1`.`a` = `v1`.`f` and `v1`.`a` = `v1`.`g` create view v2 as select a, min(1) as f, min(1) as g from t1 group by a; select * from v2; a f g @@ -13407,11 +11081,6 @@ a f g 1 1 1 explain extended select * from (select * from v2) as dt where a=f and a=g; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 7 100.00 Using where -3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `v2`.`a` AS `a`,`v2`.`f` AS `f`,`v2`.`g` AS `g` from `test`.`v2` where `v2`.`a` = `v2`.`f` and `v2`.`a` = `v2`.`g` drop view v1,v2; drop table t1; # @@ -13446,88 +11115,9 @@ union all select col2, col1 from v2; explain select * from v3 where col1=123; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -2 DERIVED t1 ref a a 5 const 1 -3 UNION t1 ref a a 5 const 1 # This must use ref accesses for reading table t1, not full scans: explain format=json select * from v3 where col1=123 and col2=321; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v3.col1 = 123 and v3.col2 = 321", - "materialized": { - "query_block": { - "union_result": { - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } - } - } - } - ] - } -} drop function f1; drop view v1,v2,v3; drop table t1, t2,t3; @@ -13546,51 +11136,6 @@ # prevents pushing it to the WHERE) explain format=json select * from v2 where (s+1) > 10 AND a > 1 and a2>123; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.s + 1 > 10 and v2.a > 1 and v2.a2 > 123", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "s + 1 > 10 and a2 > 123", - "filesort": { - "sort_key": "t1.a, f1(t1.a)", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1" - } - } - ] - } - } - } - } - } - } - ] - } -} # Extra test for 10.4+: Check that this works for pushdown into IN # subqueries: create table t4 (a int, b int, c decimal); @@ -13605,67 +11150,6 @@ (a,b,c) in (select a, f1(a), sum(b) from t1 group by a, f1(a)) and (a+1) > 10 AND b > 1 and c>123; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t4.a + 1 > 10 and t4.b > 1 and t4.c > 123 and t4.a is not null and t4.b is not null and t4.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "23", - "used_key_parts": ["a", "f1(a)", "sum(b)"], - "ref": ["test.t4.a", "test.t4.b", "test.t4.c"], - "loops": 3, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t4.c = ``.`sum(b)`", - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`f1(a)` > 1 and `sum(b)` > 123", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a + 1 > 10" - } - } - ] - } - } - } - } - } - } - ] - } -} drop view v2; drop function f1; drop table t1, t4; @@ -13705,109 +11189,7 @@ 1 21 101 1 19 132 1 19 117 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a < 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # conjunctive subformulas : pushing into WHERE # pushing equalities @@ -13818,111 +11200,7 @@ a b c a b c 8 33 114 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=8); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a=8); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a = 8" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "possible_keys": ["distinct_key"], - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 8" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 8" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 8 and t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # conjunctive subformulas : pushing into WHERE using equalities set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and (t2.a=8); @@ -13932,111 +11210,7 @@ a b c a b c 8 33 114 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=8); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (t2.a=8); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a = 8" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "possible_keys": ["distinct_key"], - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 8" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 8" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 8 and t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # conjunctive subformulas : pushing into HAVING set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and (v1.c>200); @@ -14048,110 +11222,7 @@ 5 16 207 5 14 312 5 16 207 5 33 207 explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>200); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.c>200); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # conjunctive subformulas : pushing into WHERE # conjunctive subformulas : pushing into HAVING @@ -14164,110 +11235,7 @@ 1 19 117 1 16 909 1 19 117 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a < 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 110", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 110", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100 and c > 110", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # extracted or formula : pushing into WHERE set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); @@ -14281,110 +11249,7 @@ 5 16 207 5 33 207 8 33 114 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.b > 27 or v1.b < 19", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # extracted or formula : pushing into HAVING set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where @@ -14403,111 +11268,8 @@ 1 21 101 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and ((v1.c>200) or (v1.c<105)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and ((v1.c>200) or (v1.c<105)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 200 or v1.c < 105", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (c > 200 or c < 105)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100 and (c > 200 or c < 105)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # extracted or formula : pushing into WHERE # extracted or formula : pushing into HAVING using equalities @@ -14547,112 +11309,9 @@ explain select * from v1,t2 where ((v1.a>3) and (t2.c>110) and (v1.c=t2.c)) or ((v1.a=1) and (v1.c<110)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 -1 PRIMARY ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where ((v1.a>3) and (t2.c>110) and (v1.c=t2.c)) or ((v1.a=1) and (v1.c<110)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a > 3 or v1.a = 1 and v1.c < 110" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "attached_condition": "v1.c = t2.c and v1.a > 3 and t2.c > 110 or v1.a = 1 and v1.c < 110", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.a > 3 or t1.a = 1)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.a > 3 or t1.a = 1)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using intersect in view definition # prepare of a query # conjunctive subformulas : pushing into WHERE @@ -14713,12 +11372,6 @@ (d1.b=t2.b) and (((t2.b>13) and (t2.c=909)) or ((d1.a<4) and (d1.c<200))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.b 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from t2, (select a, b, min(c) as c from t1 @@ -14730,103 +11383,6 @@ (d1.b=t2.b) and (((t2.b>13) and (t2.c=909)) or ((d1.a<4) and (d1.c<200))); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t2.b"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.c = 909 and t2.b > 13 or d1.a < 4 and d1.c < 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (t1.b > 13 or t1.a < 4 and c < 200)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a < 4)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 100 and (t1.b > 13 or t1.a < 4 and c < 200)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a < 4)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; create view v1 as select a, b, max(c) as c from t1 @@ -14849,109 +11405,7 @@ 1 33 988 1 19 132 1 21 500 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a < 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # conjunctive subformulas : pushing into WHERE # pushing equalities @@ -14964,111 +11418,7 @@ 6 20 315 6 20 211 6 20 315 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=6); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a=6); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a = 6" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "possible_keys": ["distinct_key"], - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 6" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 6" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 6 and t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # conjunctive subformulas : pushing into WHERE using equalities set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and (t2.a=6); @@ -15080,111 +11430,7 @@ 6 20 315 6 20 211 6 20 315 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=6); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (t2.a=6); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a = 6" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "possible_keys": ["distinct_key"], - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a = 6" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 6" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 6 and t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # conjunctive subformulas : pushing into HAVING set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and (v1.c>500); @@ -15200,110 +11446,7 @@ 5 14 787 5 33 207 1 33 988 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.c>500); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 500", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c > 500", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 500", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # conjunctive subformulas : pushing into WHERE # conjunctive subformulas : pushing into HAVING @@ -15316,110 +11459,7 @@ 1 33 988 1 16 909 1 33 988 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a < 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 500", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c > 500", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 500", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # extracted or formula : pushing into WHERE set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); @@ -15435,110 +11475,7 @@ 5 14 787 5 33 207 1 33 988 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.b > 27 or v1.b < 19", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # extracted or formula : pushing into HAVING set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from v1,t2 where @@ -15557,111 +11494,8 @@ 6 20 315 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and ((v1.c<400) or (v1.c>800)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and ((v1.c<400) or (v1.c>800)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 400 or v1.c > 800", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and (c < 400 or c > 800)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (c < 400 or c > 800)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # extracted or formula : pushing into WHERE # extracted or formula : pushing into HAVING using equalities @@ -15698,113 +11532,10 @@ (v1.c=t2.c) and ((v1.a>1) and (t2.c<500)) or ((v1.a=1) and (v1.c>500)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 -1 PRIMARY ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.c=t2.c) and ((v1.a>1) and (t2.c<500)) or ((v1.a=1) and (v1.c>500)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "block-nl-join": { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 9, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a > 1 or v1.a = 1 and v1.c > 500" - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "attached_condition": "v1.c = t2.c and v1.a > 1 and t2.c < 500 or v1.a = 1 and v1.c > 500", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.a > 1 or t1.a = 1)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.a > 1 or t1.a = 1)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} # using except in view definition # prepare of a query # conjunctive subformulas : pushing into WHERE @@ -15861,12 +11592,6 @@ (d1.b=t2.b) and (((t2.b>13) and (t2.c=988)) or ((d1.a>4) and (d1.c>500))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.b 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from t2, (select a, b, max(c) as c from t1 @@ -15878,103 +11603,6 @@ (d1.b=t2.b) and (((t2.b>13) and (t2.c=988)) or ((d1.a>4) and (d1.c>500))); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t2.b"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.c = 988 and t2.b > 13 or d1.a > 4 and d1.c > 500", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and (t1.b > 13 or t1.a > 4 and c > 500)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a > 4)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and (t1.b > 13 or t1.a > 4 and c > 500)", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a > 4)" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union and intersect in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -15996,168 +11624,7 @@ 6 20 309 6 20 211 6 20 309 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 UNION ALL NULL NULL NULL NULL 18 Using where -4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -5 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "__5.a > 5 and __5.c > 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 5, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 530 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 3 and t1.a > 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union and intersect in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16181,137 +11648,7 @@ 5 27 132 5 33 207 8 33 123 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 500 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 3 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union and except in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16333,137 +11670,7 @@ 6 20 309 6 20 211 6 20 309 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 5 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 5" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 530 and c > 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 3 and t1.a > 5" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union and except in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16487,137 +11694,7 @@ 5 27 132 5 33 207 8 33 123 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 200", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 200 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c < 500 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 3 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c < 200", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using except and intersect in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16639,137 +11716,7 @@ 5 27 132 5 14 312 5 27 132 5 33 207 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 150", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c < 150", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 500 and c < 150", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c > 150 and c < 150", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using except and intersect in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16789,168 +11736,7 @@ a b c a b c 8 33 123 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT ALL NULL NULL NULL NULL 18 Using where -4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -5 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 130", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "__5.a > 4 and __5.c < 130", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "having_condition": "c > 150 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 5, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 500 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using except, intersect and union in view definition # conjunctive subformulas : pushing into WHERE and HAVING @@ -16973,195 +11759,7 @@ a b c a b c 8 33 123 8 33 117 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT ALL NULL NULL NULL NULL 18 Using where -4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -5 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -6 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c < 130", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 300 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "__6.a > 4 and __6.c < 130", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 4, - "cost": "COST_REPLACED", - "having_condition": "c > 150 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 5, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 500 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } - }, - { - "query_block": { - "select_id": 6, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "c < 120 and c < 130", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using intersect in view definition # using embedded view @@ -17184,136 +11782,7 @@ 5 27 132 5 14 312 5 27 132 5 33 207 explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key0 key0 5 test.t2.a 1 Using where -2 DERIVED ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.c < 150", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 150", - "filesort": { - "sort_key": "v1.a, v1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a < 7 and v1.a > 4", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 120", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} drop view v1,v2; # using except in view definition # using embedded view @@ -17336,136 +11805,7 @@ 5 27 132 5 14 312 5 27 132 5 33 207 explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key0 key0 5 test.t2.a 1 Using where -2 DERIVED ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.c < 150", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c < 150", - "filesort": { - "sort_key": "v1.a, v1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a < 7 and v1.a > 4", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "c < 300", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c > 150", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} drop view v1,v2; # using intersect in view definition # conditions are pushed in different parts of selects @@ -17485,110 +11825,7 @@ 6 20 315 6 20 211 6 20 315 6 23 303 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and (v1.c<450); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and (v1.c<450); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 4 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.b > 12 and v1.c < 450", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 300 and t1.b > 12 and c < 450", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 4" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c > 200 and t1.a > 4 and c < 450", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b < 21 and t1.b > 12" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using except in view definition # conditions are pushed in different parts of selects @@ -17608,110 +11845,7 @@ 1 21 988 1 16 909 1 21 988 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and (v1.c>450); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and (v1.c>450); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a < 2 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.b < 30 and v1.c > 450", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 300 and t1.b < 30 and c > 450", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 20 and t1.a < 2" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c > 150 and t1.a < 2 and c > 450", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7 and t1.b < 30" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using except and union in view definition # conditions are pushed in different parts of selects @@ -17733,110 +11867,7 @@ 1 21 988 1 16 909 1 21 988 1 19 132 explain select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and (v1.c>450); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and (v1.c>450); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t2.a < 2 or t2.a < 5) and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 450", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 300 and c > 450", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 20 and (t1.a < 2 or t1.a < 5)" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "EXCEPT", - "cost": "COST_REPLACED", - "having_condition": "c > 150 and (t1.a < 2 or t1.a < 5) and c > 450", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 7" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union and intersect in view definition # conditions are pushed in different parts of selects @@ -17859,137 +11890,7 @@ 5 14 787 5 14 312 5 14 787 5 33 207 explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) and (v1.c>400); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.a 3 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) and (v1.c>400); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a > 1 and t2.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 9, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.b > 12 and v1.c > 400", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "c > 100 and t1.b > 12 and c > 400", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 9 and t1.a > 1" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "having_condition": "c < 800 and t1.a > 1 and c > 400", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 3 and t1.b > 12" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "c > 300 and c > 400", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 18, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 10 and t1.a > 1 and t1.b > 12" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; create table t3 (a int, b int, c int); insert into t3 values @@ -18020,70 +11921,7 @@ 3 21 500 3 21 231 1 21 345 3 21 231 explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<5); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key0 key0 5 test.t2.b 1 Using where -2 DERIVED t3 range i1 i1 5 NULL 5 Using index condition explain format=json select * from v1,t2 where (v1.b=t2.b) and (v1.a<5); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t2.b"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a < 5", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["i1"], - "key": "i1", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.a > 0 and t3.a < 5" - } - } - ] - } - } - } - } - ] - } -} drop view v1; # using union in view definition # conjunctive subformulas : pushing into WHERE @@ -18105,106 +11943,7 @@ 2 33 7 8 33 117 3 21 500 3 21 231 explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.b 1 Using where -2 DERIVED t3 range i1 i1 5 NULL 2 Using index condition -3 UNION t3 range i1 i1 5 NULL 1 Using index condition -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.b=t2.b) and (v1.a<4); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t2.b"], - "loops": 9, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a < 4", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["i1"], - "key": "i1", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.a > 1 and t3.a < 4" - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["i1"], - "key": "i1", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.a > 2 and t3.a < 4" - } - } - ] - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; # using union in view definition # conjunctive subformulas : pushing into WHERE @@ -18226,108 +11965,7 @@ 1 19 107 1 19 132 2 33 7 8 33 117 explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY ref key1,distinct_key key1 5 test.t2.b 2 Using where -2 DERIVED t3 range i1 i1 5 NULL 1 Using index condition -3 UNION t3 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain format=json select * from v1,t2 where (v1.b=t2.b) and (v1.a<3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 9, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.b is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key1", "distinct_key"], - "key": "key1", - "key_length": "5", - "used_key_parts": ["b"], - "ref": ["test.t2.b"], - "loops": 9, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.a < 3", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["i1"], - "key": "i1", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.a > 1 and t3.a < 3" - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "t3.a < 3", - "filesort": { - "sort_key": "t3.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.b < 21" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} drop view v1; alter table t3 drop index i1; drop table t1,t2,t3; @@ -18372,62 +12010,8 @@ 7 cc 28 explain select * from (select a, c, sum(b) over (partition by a,c) from t2) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 16 Using where -2 DERIVED t2 ALL idx NULL NULL NULL 20 Using where; Using temporary explain format=json select * from (select a, c, sum(b) over (partition by a,c) from t2) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from ( select 1 as n, a, c, sum(b) over (partition by a,c) as s from t2 @@ -18487,10 +12071,6 @@ select 2 as n, a, c, sum(b) over (partition by a) as s from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 32 Using where -2 DERIVED t2 ALL idx NULL NULL NULL 20 Using where; Using temporary -3 UNION t2 ALL idx NULL NULL NULL 20 Using where; Using temporary explain format=json select * from ( select 1 as n, a, c, sum(b) over (partition by a,c) as s from t2 @@ -18498,97 +12078,6 @@ select 2 as n, a, c, sum(b) over (partition by a) as s from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 32, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "union_result": { - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from (select a, c, sum(b) over (partition by a,c) as s from t2) as t, t1 where t1.a=t.a and t1.c=t.c and t1.c in ('aa','bb','cc'); @@ -18608,78 +12097,9 @@ explain select * from (select a, c, sum(b) over (partition by a,c) as s from t2) as t, t1 where t1.a=t.a and t1.c=t.c and t1.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where -1 PRIMARY ref key0 key0 24 test.t1.a,test.t1.c 2 -2 DERIVED t2 ALL NULL NULL NULL NULL 20 Using where; Using temporary explain format=json select * from (select a, c, sum(b) over (partition by a,c) as s from t2) as t, t1 where t1.a=t.a and t1.c=t.c and t1.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c in ('aa','bb','cc') and t1.a is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "24", - "used_key_parts": ["a", "c"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 8, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from ( select 1 as n, a, c, sum(b) over (partition by a,c) as s from t2 @@ -18749,11 +12169,6 @@ select 3 as n, a, c, sum(b) as s from t2 group by a ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 48 Using where -2 DERIVED t2 ALL idx NULL NULL NULL 20 Using where; Using temporary -3 UNION t2 ALL idx NULL NULL NULL 20 Using where; Using temporary -4 UNION t2 ALL idx NULL NULL NULL 20 Using where; Using temporary; Using filesort explain format=json select * from ( select 1 as n, a, c, sum(b) over (partition by a,c) as s from t2 @@ -18763,124 +12178,6 @@ select 3 as n, a, c, sum(b) as s from t2 group by a ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 48, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "union_result": { - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2" - } - } - ] - } - } - } - }, - { - "query_block": { - "select_id": 4, - "operation": "UNION", - "cost": "COST_REPLACED", - "having_condition": "t2.c in ('aa','bb','cc')", - "filesort": { - "sort_key": "t2.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2" - } - } - ] - } - } - } - } - ] - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by a,c) as avg_b @@ -18916,65 +12213,11 @@ avg(b) over (partition by a,c) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 16 Using where -2 DERIVED t2 ALL idx NULL NULL NULL 20 Using where; Using temporary explain format=json select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by a,c) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by a) as avg_b @@ -19010,65 +12253,11 @@ avg(b) over (partition by a) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 16 Using where -2 DERIVED t2 ALL idx NULL NULL NULL 20 Using where; Using temporary explain format=json select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by a) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "possible_keys": ["idx"], - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 80, - "attached_condition": "t2.a > 2" - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_for_derived=off' for select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by c) as avg_b @@ -19104,69 +12293,11 @@ avg(b) over (partition by c) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 20 Using where -2 DERIVED t2 ALL NULL NULL NULL NULL 20 Using where; Using temporary explain format=json select * from (select a, c, sum(b) over (partition by a,c) as sum_b, avg(b) over (partition by c) as avg_b from t2 ) as t where t.a > 2 and t.c in ('aa','bb','cc'); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.a, t2.c" - } - }, - { - "filesort": { - "sort_key": "t2.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 20, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.c in ('aa','bb','cc')" - } - } - ] - } - } - } - } - } - } - ] - } -} drop table t1,t2; set optimizer_switch= @save_optimizer_switch; # @@ -19222,82 +12353,11 @@ (select a, sum(t2.b) as s, min(t2.c) as m from t2 group by t2.a) t on t1.a=t.a where t1.b < 3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 range idx_b idx_b 5 NULL 4 100.00 Using index condition; Using where -1 PRIMARY ref key0 key0 5 test.t1.a 1 100.00 -2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`c`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` < 3 explain format=json select t1.a,t.s,t.m from t1 join (select a, sum(t2.b) as s, min(t2.c) as m from t2 group by t2.a) t on t1.a=t.a where t1.b < 3; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "range", - "possible_keys": ["idx_b"], - "key": "idx_b", - "key_length": "5", - "used_key_parts": ["b"], - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t1.b < 3", - "attached_condition": "t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 4, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t1.a is not null", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} prepare stmt from "select t1.a,t.s,t.m from t1 join (select a, sum(t2.b) as s, min(t2.c) as m from t2 group by t2.a) t @@ -19351,78 +12411,11 @@ (select a, sum(t2.b) as s, min(t2.b) as m from t2 group by t2.a) t on t1.a=t.a where t1.b <= 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL idx_b NULL NULL NULL 12 83.33 Using where -1 PRIMARY ref key0 key0 5 test.t1.a 1 100.00 -2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`b`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <= 5 explain format=json select t1.a,t.s,t.m from t1 join (select a, sum(t2.b) as s, min(t2.b) as m from t2 group by t2.a) t on t1.a=t.a where t1.b <= 5; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["idx_b"], - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 83.33333588, - "attached_condition": "t1.b <= 5 and t1.a is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 10, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t1.a is not null", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} prepare stmt from "select t1.a,t.s,t.m from t1 join (select a, sum(t2.b) as s, min(t2.b) as m from t2 group by t2.a) t @@ -19474,77 +12467,10 @@ from t1 left join (select a, max(t2.b) max, min(t2.b) min from t2 group by t2.a) t on t1.a=t.a; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 -1 PRIMARY ref key0 key0 5 test.t1.a 1 100.00 Using where -2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t1` left join (/* select#2 */ select `test`.`t2`.`a` AS `a`,max(`test`.`t2`.`b`) AS `max`,min(`test`.`t2`.`b`) AS `min` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` on(`t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where 1 explain format=json select t1.a,t.max,t.min from t1 left join (select a, max(t2.b) max, min(t2.b) min from t2 group by t2.a) t on t1.a=t.a; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 12, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "trigcond(trigcond(t1.a is not null))", - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t1.a is not null", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} create table t3 (a int, b int, c char(127), index idx_b(b)) engine=myisam charset=latin1; insert into t3 values (8,11,'aa'), (5,15,'cc'), (1,14,'bb'), (2,12,'aa'), (7,17,'cc'), @@ -19584,82 +12510,11 @@ (select a, c, max(b) max, min(b) min from t4 group by a,c) t on t3.a=t.a and t3.c=t.c where t3.b > 15; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where -1 PRIMARY ref key0 key0 133 test.t3.a,test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15 explain format=json select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by a,c) t on t3.a=t.a and t3.c=t.c where t3.b > 15; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["idx_b"], - "key": "idx_b", - "key_length": "5", - "used_key_parts": ["b"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.b > 15", - "attached_condition": "t3.a is not null and t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.a is not null and t3.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by a,c) t @@ -19681,78 +12536,11 @@ (select a, c, max(b) max, min(b) min from t4 group by a,c) t on t3.a=t.a and t3.c=t.c where t3.b <= 15; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where -1 PRIMARY ref key0 key0 133 test.t3.a,test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15 explain format=json select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by a,c) t on t3.a=t.a and t3.c=t.c where t3.b <= 15; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "possible_keys": ["idx_b"], - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 83.33333588, - "attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 10, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.a is not null and t3.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by c,a) t @@ -19774,82 +12562,11 @@ (select a, c, max(b) max, min(b) min from t4 group by c,a) t on t3.a=t.a and t3.c=t.c where t3.b > 15; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where -1 PRIMARY ref key0 key0 133 test.t3.a,test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15 explain format=json select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by c,a) t on t3.a=t.a and t3.c=t.c where t3.b > 15; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["idx_b"], - "key": "idx_b", - "key_length": "5", - "used_key_parts": ["b"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t3.b > 15", - "attached_condition": "t3.a is not null and t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.a is not null and t3.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by c,a) t @@ -19871,78 +12588,11 @@ (select a, c, max(b) max, min(b) min from t4 group by c,a) t on t3.a=t.a and t3.c=t.c where t3.b <= 15; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where -1 PRIMARY ref key0 key0 133 test.t3.a,test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15 explain format=json select t3.a,t3.c,t.max,t.min from t3 join (select a, c, max(b) max, min(b) min from t4 group by c,a) t on t3.a=t.a and t3.c=t.c where t3.b <= 15; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "possible_keys": ["idx_b"], - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 83.33333588, - "attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 10, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.a is not null and t3.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["a", "c"], - "ref": ["test.t3.a", "test.t3.c"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} drop index idx_a on t2; create index idx on t2(c,b); create index idx_a on t3(a); @@ -19976,97 +12626,9 @@ explain extended select t2.a,t2.b,t2.c,t.c as t_c,t.max,t.min from t2, t3, (select c, max(b) max, min(b) min from t4 group by c) t where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where -1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where -1 PRIMARY ref key0 key0 128 test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`t`.`c` AS `t_c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z') explain format=json select t2.a,t2.b,t2.c,t.c as t_c,t.max,t.min from t2, t3, (select c, max(b) max, min(b) min from t4 group by c) t where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "range", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["c", "b"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')", - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "t3", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 3, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx_c"], - "key": "idx_c", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select t2.a,t2.b,t2.c,t.c as t_c,t.max,t.min from t2, t3, (select c, max(b) max, min(b) min from t4 group by c) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; @@ -20146,91 +12708,9 @@ explain extended select t2.a,t2.b,t2.c,t.c as t_c,t.max,t.min from t2, t3, (select c, max(b) max, min(b) min from t4 group by c) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 90 60.00 Using where -1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where -1 PRIMARY ref key0 key0 128 test.t3.c 1 100.00 -2 DERIVED t4 ALL idx_c NULL NULL NULL 160 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`t`.`c` AS `t_c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` group by `test`.`t4`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` < 40 explain format=json select t2.a,t2.b,t2.c,t.c as t_c,t.max,t.min from t2, t3, (select c, max(b) max, min(b) min from t4 group by c) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 90, - "cost": "COST_REPLACED", - "filtered": 60, - "attached_condition": "t2.b < 40 and t2.a is not null" - } - }, - { - "table": { - "table_name": "t3", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 53.99999991, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 80.99999987, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t4.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ALL", - "possible_keys": ["idx_c"], - "loops": 1, - "rows": 160, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c; @@ -20268,108 +12748,9 @@ explain extended select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where -1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where -1 PRIMARY ref key0 key0 128 test.t3.c 1 100.00 -2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`t`.`c` AS `c`,`t`.`b` AS `b`,`t`.`sum(b) over (partition by c)` AS `sum(b) over (partition by c)` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,`test`.`t4`.`b` AS `b`,sum(`test`.`t4`.`b`) over ( partition by `test`.`t4`.`c`) AS `sum(b) over (partition by c)` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z') explain format=json select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "range", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "133", - "used_key_parts": ["c", "b"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')", - "attached_condition": "t2.a is not null" - } - }, - { - "table": { - "table_name": "t3", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 3, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t3.c is not null", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t4.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ref", - "possible_keys": ["idx_c"], - "key": "idx_c", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} set statement optimizer_switch='split_materialized=off' for select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; @@ -20689,97 +13070,9 @@ explain extended select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 90 60.00 Using where -1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where -1 PRIMARY ref key0 key0 128 test.t3.c 10 100.00 -2 DERIVED t4 ALL idx_c NULL NULL NULL 160 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`t`.`c` AS `c`,`t`.`b` AS `b`,`t`.`sum(b) over (partition by c)` AS `sum(b) over (partition by c)` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,`test`.`t4`.`b` AS `b`,sum(`test`.`t4`.`b`) over ( partition by `test`.`t4`.`c`) AS `sum(b) over (partition by c)` from `test`.`t4`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` < 40 explain format=json select * from t2, t3, (select c, b, sum(b) over (partition by c) from t4 ) t where t2.b < 40 and t2.a=t3.a and t3.c=t.c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 90, - "cost": "COST_REPLACED", - "filtered": 60, - "attached_condition": "t2.b < 40 and t2.a is not null" - } - }, - { - "table": { - "table_name": "t3", - "access_type": "ref", - "possible_keys": ["idx_a"], - "key": "idx_a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.a"], - "loops": 53.99999991, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t3.c"], - "loops": 80.99999987, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t4.c" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "ALL", - "possible_keys": ["idx_c"], - "loops": 1, - "rows": 160, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } -} drop table t1,t2,t3,t4; # # MDEV-13709: Optimization for semi-joins of grouping derived tables @@ -20816,130 +13109,7 @@ a c 1 foo explain extended SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t4 range a a 5 NULL 1 100.00 Using index condition; Using where -1 PRIMARY ref key0 key0 128 test.t4.c 1 100.00 FirstMatch(t4) -3 LATERAL DERIVED t3 ref c c 128 test.t4.c 2 100.00 -3 LATERAL DERIVED eq_ref distinct_key distinct_key 4 func 1 100.00 -4 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 100.00 -4 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c` from `test`.`t4` semi join (`test`.`v1`) where `v1`.`c` = `test`.`t4`.`c` and `test`.`t4`.`a` < 2 explain format=json SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t4", - "access_type": "range", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "index_condition": "t4.a < 2", - "attached_condition": "t4.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t4.c"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "first_match": "t4", - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "const_condition": "1", - "outer_ref_condition": "t4.c is not null", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ref", - "possible_keys": ["c"], - "key": "c", - "key_length": "128", - "used_key_parts": ["c"], - "ref": ["test.t4.c"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "4", - "used_key_parts": ["a"], - "ref": ["func"], - "rows": 1, - "filtered": 100, - "materialized": { - "unique": 1, - "query_block": { - "select_id": 4, - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 3, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL", - "attached_condition": "t2.i = t1.i and t2.i = t1.i" - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v1; DROP TABLE t1,t2,t3,t4; # @@ -20982,11 +13152,6 @@ pk EXPLAIN EXTENDED WITH cte AS ( SELECT pk FROM t1 WHERE pk IS NULL GROUP BY pk ) SELECT * FROM cte; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 0 0.00 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Note 1003 with cte as (/* select#2 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where 0 group by `test`.`t1`.`pk`)/* select#1 */ select NULL AS `pk` from `cte` DROP TABLE t1; # # MDEV-14880: assertion failure in optimizer when splitting is applied @@ -21001,74 +13166,7 @@ 1 0 1 1 2 0 2 1 EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 100.00 Using where -1 PRIMARY ref key0 key0 4 test.t1.pk1 1 100.00 -2 LATERAL DERIVED t2 eq_ref PRIMARY PRIMARY 4 test.t1.pk1 1 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`f` AS `f`,`v2`.`pk2` AS `pk2`,`v2`.`cnt` AS `cnt` from `test`.`t1` join `test`.`v2` where `v2`.`pk2` = `test`.`t1`.`pk1` and `test`.`t1`.`f` <> 5 EXPLAIN FORMAT=JSON SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["PRIMARY"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.f <> 5" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "4", - "used_key_parts": ["pk2"], - "ref": ["test.t1.pk1"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["pk2"], - "ref": ["test.t1.pk1"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v2; DROP TABLE t1,t2; # @@ -21092,11 +13190,6 @@ f f EXPLAIN EXTENDED SELECT * FROM v1 JOIN v2 ON v1.f = v2.f; -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 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select NULL AS `f`,`v2`.`f` AS `f` from `test`.`t1` `a` straight_join `test`.`t1` `b` join `test`.`v2` where 0 DROP VIEW v1,v2; DROP TABLE t1; # @@ -21139,11 +13232,6 @@ cte as (select median(f2) over (partition by f1) as k1 from t1 order by f1), cte1 as (select median(f4) over (partition by f1) as k2 from t1) select k1,k2 from cte1, cte; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 5 -1 PRIMARY ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) -3 DERIVED t1 ALL NULL NULL NULL NULL 5 Using temporary -2 DERIVED t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort drop table t1; # # MDEV-16104: embedded splittable materialized derived/views @@ -21160,13 +13248,6 @@ USING (f); EXPLAIN EXTENDED SELECT * FROM ( SELECT STRAIGHT_JOIN f, COUNT(*) as c FROM v1 GROUP BY f ) AS s; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 7 100.00 -2 DERIVED ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort -2 DERIVED a2 eq_ref PRIMARY PRIMARY 4 a1.f 1 100.00 Using index -4 DERIVED t1 index PRIMARY PRIMARY 4 NULL 7 100.00 Using index; Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `s`.`f` AS `f`,`s`.`c` AS `c` from (/* select#2 */ select straight_join `a2`.`f` AS `f`,count(0) AS `c` from (/* select#4 */ select `test`.`t1`.`f` AS `f`,count(0) AS `c` from `test`.`t1` group by `test`.`t1`.`f`) `a1` join `test`.`t1` `a2` where `a2`.`f` = `a1`.`f` group by `a2`.`f`) `s` SELECT * FROM ( SELECT STRAIGHT_JOIN f, COUNT(*) as c FROM v1 GROUP BY f ) AS s; f c 1 1 @@ -21227,13 +13308,6 @@ FROM t1, t2 GROUP BY t1.b,t2.c) dt WHERE t3.d = dt.b; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where -1 PRIMARY ref key0 key0 5 test.t3.d 1 100.00 -2 LATERAL DERIVED t1 ref idx_b idx_b 5 test.t3.d 1 100.00 Using index; Using temporary; Using filesort -2 LATERAL DERIVED t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`d` AS `d`,`dt`.`b` AS `b`,`dt`.`c` AS `c` from `test`.`t3` join (/* select#2 */ select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`b` = `test`.`t3`.`d` group by `test`.`t1`.`b`,`test`.`t2`.`c`) `dt` where `dt`.`b` = `test`.`t3`.`d` DROP TABLE t1,t2,t3; # # MDEV-17419: splittable materialized derived/view @@ -21262,10 +13336,6 @@ left join (select * from t2 as au group by au.userid) as auditlastlogin on u.id=auditlastlogin.userid; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY u ALL NULL NULL NULL NULL 2 -1 PRIMARY ref key0 key0 5 test.u.id 1 -2 DERIVED au ALL NULL NULL NULL NULL 4 Using temporary; Using filesort select * from t1 as u left join (select * from t2 as au group by au.userid) as auditlastlogin @@ -21317,13 +13387,6 @@ 19 119 20 120 explain extended select id, a from t1 where id in (select id from v1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00 -1 PRIMARY ref key0 key0 4 test.t1.id 1 100.00 FirstMatch(t1) -3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort -3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id` select id, a from t1 where id in (select id from (select t1.* from t1 left join t2 @@ -21355,13 +13418,6 @@ from (select t1.* from t1 left join t2 on (t1.id = t2.ro_id AND t2.flag = 1) group by t1.id) dt); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00 -1 PRIMARY ref key1,distinct_key key1 4 test.t1.id 1 100.00 FirstMatch(t1) -3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort -3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where 1 group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id` drop view v1; drop table t1,t2; # @@ -21572,118 +13628,8 @@ 21 2 2 2 explain select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY t1 ref a a 5 test.t3.id 1 -1 PRIMARY ref key0 key0 5 test.t3.id 1 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007 -2 DERIVED cp2 range NULL a 5 NULL 7 Using index for group-by explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.`id` is not null and t3.`id` is not null" - } - }, - { - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "cp2", - "access_type": "range", - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index_for_group_by": true - } - } - ] - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "4", - "used_key_parts": ["a"], - "ref": ["func"], - "rows": 1, - "filtered": 100, - "materialized": { - "unique": 1, - "query_block": { - "select_id": 3, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 1007, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} set optimizer_switch="split_materialized=default"; select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); @@ -21692,123 +13638,8 @@ 21 2 2 2 explain select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY t1 ref a a 5 test.t3.id 1 -1 PRIMARY ref key0 key0 5 test.t3.id 1 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007 -2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using where; Using index explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.`id` is not null and t3.`id` is not null" - } - }, - { - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "outer_ref_condition": "t1.a is not null", - "nested_loop": [ - { - "table": { - "table_name": "cp2", - "access_type": "ref", - "possible_keys": ["a"], - "key": "a", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t1.a"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "cp2.a = t3.`id`", - "using_index": true - } - } - ] - } - } - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "4", - "used_key_parts": ["a"], - "ref": ["func"], - "rows": 1, - "filtered": 100, - "materialized": { - "unique": 1, - "query_block": { - "select_id": 3, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 1007, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - ] - } -} prepare stmt from "select * from t1, (select a from t1 cp2 group by a) dt, t3 where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2)"; execute stmt; @@ -21913,11 +13744,6 @@ JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx ON tx.t1_id = t1.id WHERE t1.id BETWEEN 200 AND 100000; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index -1 PRIMARY ref key0 key0 5 test.t3.t1_id 1 -2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 1 Using index condition; Using where EXPLAIN FORMAT=JSON SELECT t1.id FROM t1 JOIN t3 @@ -21925,88 +13751,6 @@ JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx ON tx.t1_id = t1.id WHERE t1.id BETWEEN 200 AND 100000; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "range", - "possible_keys": ["t1_id"], - "key": "t1_id", - "key_length": "5", - "used_key_parts": ["t1_id"], - "loops": 1, - "rows": 47, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.t1_id between 200 and 100000 and t3.t1_id is not null", - "using_index": true - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["id"], - "ref": ["test.t3.t1_id"], - "loops": 47, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["t1_id"], - "ref": ["test.t3.t1_id"], - "loops": 47, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["t1_id"], - "key": "t1_id", - "key_length": "5", - "used_key_parts": ["t1_id"], - "ref": ["test.t1.id"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 34.55045319, - "index_condition": "t2.t1_id between 200 and 100000 and t2.t1_id = t3.t1_id", - "attached_condition": "t2.reporting_person = 1" - } - } - ] - } - } - } - } - ] - } -} set optimizer_switch='split_materialized=off'; SELECT t1.id FROM t1 @@ -22023,11 +13767,6 @@ JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx ON tx.t1_id = t1.id WHERE t1.id BETWEEN 200 AND 100000; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index -1 PRIMARY ref key0 key0 5 test.t3.t1_id 1 -2 DERIVED t2 ALL t1_id NULL NULL NULL 2408 Using where; Using temporary; Using filesort set optimizer_switch='split_materialized=default'; DROP TABLE t1,t2,t3; # @@ -22149,11 +13888,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8 -1 PRIMARY ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 1 -2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2 -2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where EXPLAIN FORMAT=JSON SELECT charges.id, charges.from_ledger_id, @@ -22172,89 +13906,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "charges", - "access_type": "ref", - "possible_keys": [ - "PRIMARY", - "fk_charge_from_ledger", - "fk_charge_to_ledger" - ], - "key": "fk_charge_to_ledger", - "key_length": "8", - "used_key_parts": ["to_ledger_id"], - "ref": ["const"], - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "17", - "used_key_parts": ["ledger_id", "charge_id"], - "ref": ["test.charges.from_ledger_id", "test.charges.id"], - "loops": 8, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "transaction_items", - "access_type": "ref", - "possible_keys": ["fk_items_transaction", "fk_items_charge"], - "key": "fk_items_charge", - "key_length": "9", - "used_key_parts": ["charge_id"], - "ref": ["test.charges.id"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "transactions", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "fk_transactions_ledger"], - "key": "PRIMARY", - "key_length": "8", - "used_key_parts": ["id"], - "ref": ["test.transaction_items.transaction_id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "transactions.ledger_id = charges.from_ledger_id" - } - } - ] - } - } - } - } - ] - } -} set optimizer_switch='split_materialized=off'; SELECT charges.id, @@ -22301,11 +13952,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8 -1 PRIMARY ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 1 -2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort -2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1 INSERT INTO charges (id, from_ledger_id, to_ledger_id, amount) VALUES (101, 4, 2, 100), (102, 7, 2, 200); set optimizer_switch='split_materialized=on'; @@ -22356,11 +14002,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10 -1 PRIMARY ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 1 -2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2 -2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where EXPLAIN FORMAT=JSON SELECT charges.id, charges.from_ledger_id, @@ -22379,85 +14020,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "charges", - "access_type": "ref", - "possible_keys": ["fk_charge_to_ledger"], - "key": "fk_charge_to_ledger", - "key_length": "8", - "used_key_parts": ["to_ledger_id"], - "ref": ["const"], - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "18", - "used_key_parts": ["ledger_id", "charge_id"], - "ref": ["test.charges.from_ledger_id", "test.charges.id"], - "loops": 10, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "lateral": 1, - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "transaction_items", - "access_type": "ref", - "possible_keys": ["fk_items_transaction", "fk_items_charge"], - "key": "fk_items_charge", - "key_length": "9", - "used_key_parts": ["charge_id"], - "ref": ["test.charges.id"], - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "transactions", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "fk_transactions_ledger"], - "key": "PRIMARY", - "key_length": "8", - "used_key_parts": ["id"], - "ref": ["test.transaction_items.transaction_id"], - "loops": 2, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "transactions.ledger_id = charges.from_ledger_id" - } - } - ] - } - } - } - } - ] - } -} set optimizer_switch='split_materialized=off'; SELECT charges.id, @@ -22506,11 +14068,6 @@ ON from_agg_items.charge_id = charges.id AND from_agg_items.ledger_id = charges.from_ledger_id WHERE charges.to_ledger_id = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10 -1 PRIMARY ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 1 -2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort -2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1 set optimizer_switch='split_materialized=default'; DROP TABLE transaction_items; DROP TABLE transactions; @@ -22570,13 +14127,6 @@ LEFT JOIN v1 ON (v1.id1 = dt.a) WHERE t3.oid = t1.id AND t3.oid = t2.id AND t3.wid = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 const PRIMARY,oid PRIMARY 4 const 1 -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index -1 PRIMARY t2 const PRIMARY PRIMARY 4 const 1 Using index -1 PRIMARY t4 const PRIMARY,a NULL NULL NULL 0 Impossible ON condition -1 PRIMARY ref key0 key0 5 const 0 Using where -3 LATERAL DERIVED t5 ref id1 id1 5 const 0 Using index DROP VIEW v1; DROP TABLE t1,t2,t3,t4,t5; # End of 10.3 tests @@ -22595,10 +14145,6 @@ select * from v1; f explain select * from v1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary drop view v1; drop table t1; # @@ -22620,72 +14166,7 @@ aa a explain extended select * from v1 where r < 'x'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where -3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `v1`.`r` AS `r` from `test`.`v1` where `v1`.`r` < 'x' explain format=json select * from v1 where r < 'x'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 0.010134054, - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": 0.010134054, - "filtered": 100, - "attached_condition": "v1.r < 'x'", - "materialized": { - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 2, - "cost": 0.010504815, - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": 0.010504815, - "filtered": 100, - "attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'" - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "UNION", - "table": { - "message": "No tables used" - } - } - } - ] - } - } - } - } - } - ] - } -} prepare stmt from "select * from v1 where r < 'x'"; execute stmt; r @@ -22726,11 +14207,6 @@ where dt.a=t1.a and t3.a < 3 ) as SUBQ from t1 limit 5; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 1 -3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10 select a, ( select concat(t3.a,'=',dt.s) @@ -22761,11 +14237,6 @@ where dt.a=t1.a and t3.a < 3 ) as SUBQ from t1 limit 5; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 1 -3 DERIVED t2 ALL a NULL NULL NULL 1000 Using temporary; Using filesort select a, ( select concat(t3.a,'=',dt.s) @@ -22866,11 +14337,6 @@ WHERE t1.valint1 = dt.valint1 AND t1.valdate = dt.maxdate AND t1.valint1 IN (SELECT * FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 21 Using where; Start temporary -1 PRIMARY t1 ref valint1,valint1_2 valint1 5 test.t2.a 1 Using index condition; Using where; End temporary -1 PRIMARY ref key0 key0 11 test.t1.valdate,test.t1.valint1 1 -2 LATERAL DERIVED t ref valint1,valint1_2 valint1 5 test.t2.a 1 Using index condition SELECT t1.valdouble, t1.valint1 FROM t1, (SELECT max(t.valdate) AS maxdate, t.valint1 FROM t1 t GROUP BY t.valint1) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.derived_cond_pushdown/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.derived_view' mysql-test-run: restarting replay server... Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 199893 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: 19071 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 mysql-test-run: replay server restarted (pid 199893) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_view.test" ReplayTest: At line 980 ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_view.test" ReplayTest: At line 989 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.derived_view [ fail ] Test ended at 2026-04-23 23:14:59 CURRENT_TEST: main.derived_view --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_view.result 2026-04-17 18:40:40.394795906 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/derived_view.reject 2026-04-23 23:14:59.352586324 +0300 @@ -76,14 +76,14 @@ 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 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 0 +Handler_read_rnd_next 2 flush status; select * from (select * from t1 where f1 in (2,3)) tt where f11=2; f1 f11 @@ -165,14 +165,14 @@ 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 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 0 +Handler_read_rnd_next 2 flush status; select * from v4 where f2 in (1,3); f2 f22 @@ -233,14 +233,14 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 6 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 0 +Handler_read_rnd_next 2 flush status; select * from t1 join (select * from t2 group by f2) tt on f1=f2; f1 f11 f2 f22 @@ -344,14 +344,14 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 6 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 0 +Handler_read_rnd_next 2 flush status; select * from t1 join v2 on f1=f2; f1 f11 f2 f22 @@ -573,7 +573,7 @@ 5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 /* select#1 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11`,`tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#3 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` join (/* select#5 */ select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where `t1`.`f1` < 7 and `t1`.`f1` > 2 and `t1`.`f1` > 2 group by `t1`.`f1`) `tt` where `tt`.`f1` = `tt`.`f1` and `tt`.`f1` > 2 and `tt`.`f1` > 2 +Note 1003 /* select#1 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11`,`tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#3 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` join (/* select#5 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` = `tt`.`f1` and `tt`.`f1` > 2 and `tt`.`f1` > 2 explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) x join @@ -695,7 +695,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where `t1`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` join `test`.`t1` where `test`.`t1`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 and `test`.`t1`.`f1` < 7 select * from (select * from (select * from t1 where f1 < 7 ) tt where f1 > 2 ) x @@ -723,7 +723,7 @@ 2 DERIVED ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort 3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort Warnings: -Note 1003 /* select#1 */ select `x`.`f1` AS `f1`,`x`.`f11` AS `f11`,`z`.`f1` AS `f1`,`z`.`f11` AS `f11` from (/* select#2 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#3 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `x` join (/* select#4 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#5 */ select `t1`.`f1` AS `f1`,`t1`.`f11` AS `f11` from `test`.`t1` where `t1`.`f1` < 7 and `t1`.`f1` > 2 group by `t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `z` where `z`.`f1` = `x`.`f1` +Note 1003 /* select#1 */ select `x`.`f1` AS `f1`,`x`.`f11` AS `f11`,`z`.`f1` AS `f1`,`z`.`f11` AS `f11` from (/* select#2 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#3 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `x` join (/* select#4 */ select `tt`.`f1` AS `f1`,`tt`.`f11` AS `f11` from (/* select#5 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11` from `test`.`t1` where `test`.`t1`.`f1` < 7 and `test`.`t1`.`f1` > 2 group by `test`.`t1`.`f1`) `tt` where `tt`.`f1` > 2 group by `tt`.`f1`) `z` where `z`.`f1` = `x`.`f1` explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) x @@ -1129,42 +1129,42 @@ EXPLAIN SELECT MIN(a) FROM t1 WHERE a >= 5; 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(a) FROM (SELECT * FROM t1) t WHERE a >= 5; MIN(a) 5 EXPLAIN SELECT MIN(a) FROM(SELECT * FROM t1) t WHERE a >= 5; 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(a) FROM v1 WHERE a >= 5; MIN(a) 5 EXPLAIN SELECT MIN(a) FROM v1 WHERE a >= 5; 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 MAX(b) FROM t1 WHERE a=7 AND b<75; MAX(b) 74 EXPLAIN SELECT MAX(b) FROM t1 WHERE a=7 AND b<75; 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 MAX(b) FROM (SELECT * FROM t1) t WHERE a=7 AND b<75; MAX(b) 74 EXPLAIN SELECT MAX(b) FROM (SELECT * FROM t1) t WHERE a=7 AND b<75; 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 MAX(b) FROM v1 WHERE a=7 AND b<75; MAX(b) 74 EXPLAIN SELECT MAX(b) FROM v1 WHERE a=7 AND b<75; 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 DROP VIEW v1; DROP TABLE t1; # @@ -1706,8 +1706,7 @@ EXPLAIN SELECT * FROM (SELECT * FROM (SELECT @b) AS t) AS s; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 1 -2 DERIVED system NULL NULL NULL NULL 1 +1 PRIMARY system NULL NULL NULL NULL 1 3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used SELECT * FROM (SELECT * FROM (SELECT @b) AS t) AS s; @b @@ -1973,11 +1972,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t3) -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); @@ -1988,11 +1982,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ref key1 key1 8 const,const 0 FirstMatch(t3) -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.derived_view/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.distinct [ pass ] 435 ReplayTest: Loading context main.distinct_notembedded [ fail ] Test ended at 2026-04-23 23:15:04 CURRENT_TEST: main.distinct_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/distinct_notembedded.result 2026-04-02 14:38:09.341657689 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/distinct_notembedded.reject 2026-04-23 23:15:04.592495577 +0300 @@ -124,12 +124,7 @@ SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.prepare_sum_aggregators')) AS JS FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "function": "count(distinct (/* select#2 */ select t1.a))", - "aggregator_type": "distinct" - } -] +NULL CREATE TABLE t2 (a INT); INSERT INTO t2 VALUES (1), (2); # Optimization is not applied 'cause there is more than one table Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.distinct_notembedded/' main.errors [ pass ] 50 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: explain format=json insert into t1 values ((select max(a) from t0)) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Table 'seq_1_to_100' already exists ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_json.test" ReplayTest: At line 144 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.explain_json [ fail ] Test ended at 2026-04-23 23:15:06 CURRENT_TEST: main.explain_json --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_json.result 2026-04-02 14:38:09.343657683 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_json.reject 2026-04-23 23:15:06.442464050 +0300 @@ -584,35 +584,7 @@ } create table t1 like t0; explain format=json insert into t1 values ((select max(a) from t0)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - }, - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t0", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } -} +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 drop table t1; # # A derived table @@ -798,76 +770,6 @@ insert into t2 select * from t1; explain format=json select * from t1,t2 where t1.a in ( select seq+0 from seq_1_to_100); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["seq+0"], - "ref": ["func"], - "rows": 1, - "filtered": 100, - "attached_condition": "t1.a = seq_1_to_100.seq + 0", - "materialized": { - "unique": 1, - "query_block": { - "select_id": 2, - "nested_loop": [ - { - "table": { - "table_name": "seq_1_to_100", - "access_type": "index", - "key": "PRIMARY", - "key_length": "8", - "used_key_parts": ["seq"], - "loops": 1, - "rows": 100, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - } - ] - } - } - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 10, - "rows": 10, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "19Kb", - "join_type": "BNL" - } - } - ] - } -} # # First-Match # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.explain_json/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.fetch_first [ pass ] 160 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.func_gconcat [ pass ] 1288 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.func_str [ fail ] Test ended at 2026-04-23 23:15:12 CURRENT_TEST: main.func_str --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_str.result 2026-04-17 18:40:40.407796709 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_str.reject 2026-04-23 23:15:12.164737670 +0300 @@ -949,10 +949,6 @@ Warnings: Note 1003 select export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y', _latin2'n', _latin2' ')` explain extended select FIELD('b' COLLATE latin1_bin,'A','B'); -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 field('b' collate latin1_bin,'A','B') AS `FIELD('b' COLLATE latin1_bin,'A','B')` explain extended select FIND_IN_SET(_latin1'B', _latin1'a,b,c,d'); 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 @@ -5829,48 +5825,62 @@ insert into t values ('ddd'), ('bbcd'), ('bba'), ('b%_cd'), ('aaa'); explain select * from t where substr(c, 1, 2) = 'bb'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1, 2) = 'bb'; c bba bbcd explain select * from t where 'bb' = substr(c, 1, 2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where 'bb' = substr(c, 1, 2); c bba bbcd explain select * from t where left(c, 2) = 'bb'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where left(c, 2) = 'bb'; c bba bbcd explain select * from t where 'bb' = left(c, 2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where 'bb' = left(c, 2); c bba bbcd explain select * from t where substr(c, 1, 4) = 'b%_c'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 1 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. select * from t where substr(c, 1, 4) = 'b%_c'; c b%_cd explain select * from t where substr(c, 1, 2) = concat('b', 'b'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1, 2) = concat('b', 'b'); c bba bbcd explain select * from t where substr(c, 1, 2) = substr('bb1', 1, 2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1, 2) = substr('bb1', 1, 2); c bba @@ -5879,29 +5889,41 @@ insert into t1 select seq, seq / 33 from seq_1_to_100; explain select * from t1 where substr(a, 1, 2)='80'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 35 NULL 1 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 383. explain select * from t1 where substr(a, 1, b)='80'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 35 NULL 1 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 383. create view v1 as select a,b from t1; explain select * from v1 where substr(a, 1, 2)='80'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 35 NULL 1 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 383. drop view v1; drop table t1; explain select * from t where substr(c, 1, 1) = 'bb'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1, 1) = 'bb'; c explain select * from t where substr(c, 1, 3) = 'bb'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1, 3) = 'bb'; c explain select * from t where substr(c, 1) = 'bb'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t range c c 8 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 367. select * from t where substr(c, 1) = 'bb'; c explain select * from t where substr(c, 1, 2) = substr(c, 2, 3); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_str/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_by [ fail ] Test ended at 2026-04-23 23:15:14 CURRENT_TEST: main.group_by --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_by.result 2026-04-17 18:40:40.420797512 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_by.reject 2026-04-23 23:15:14.260333704 +0300 @@ -1870,13 +1870,13 @@ INSERT INTO t2 VALUES (1), (2); EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; 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(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; MIN(t2.a) 1 EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; 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 MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a; MAX(t2.a) 2 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_by/' ***Warnings generated in error logs during shutdown after running tests: main.group_by 2026-04-23 23:15:14 4 [ERROR] mariadbd: Out of sort memory, consider increasing server sort buffer size ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.group_by_cardinality [ fail ] Test ended at 2026-04-23 23:15:15 CURRENT_TEST: main.group_by_cardinality --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_by_cardinality.result 2026-04-02 14:38:09.371657608 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_by_cardinality.reject 2026-04-23 23:15:15.659310867 +0300 @@ -26,33 +26,14 @@ 1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 10 -1 PRIMARY ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join) +1 PRIMARY ALL NULL NULL NULL NULL 21 Using join buffer (flat, BNL join) 2 DERIVED t1 index NULL groups_20 5 NULL 20000 Using index select json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) -[ - { - "join_output_cardinality": 20000, - "estimation": - [ - { - "table": "t1", - "steps": - [ - { - "index_name": "groups_20", - "cardinality": 20.99999895 - } - ], - "cardinality": 20.99999895 - } - ], - "post_group_cardinality": 20.99999895 - } -] +NULL # Case 2: one non- indexed column explain select * @@ -71,26 +52,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) -[ - { - "join_output_cardinality": 20000, - "estimation": - [ - { - "table": "t1", - "steps": - [ - { - "column": "groups_20_2", - "cardinality": 20.99999895 - } - ], - "cardinality": 20.99999895 - } - ], - "post_group_cardinality": 20.99999895 - } -] +NULL # Case 4: one indexed column, multiple tables create table t3(c int); insert into t3 select seq from seq_1_to_10; @@ -102,7 +64,7 @@ group by groups_20) TBL; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 10 -1 PRIMARY ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join) +1 PRIMARY ALL NULL NULL NULL NULL 21 Using join buffer (flat, BNL join) 2 DERIVED t3 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort 2 DERIVED t1 index NULL groups_20 5 NULL 20000 Using index; Using join buffer (flat, BNL join) select @@ -110,26 +72,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) -[ - { - "join_output_cardinality": 200000, - "estimation": - [ - { - "table": "t1", - "steps": - [ - { - "index_name": "groups_20", - "cardinality": 20.99999895 - } - ], - "cardinality": 20.99999895 - } - ], - "post_group_cardinality": 20.99999895 - } -] +NULL # Case 5: group by two tables explain select * @@ -139,7 +82,7 @@ group by groups_20, t3.c) TBL; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 10 -1 PRIMARY ALL NULL NULL NULL NULL 209 Using join buffer (flat, BNL join) +1 PRIMARY ALL NULL NULL NULL NULL 210 Using join buffer (flat, BNL join) 2 DERIVED t3 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort 2 DERIVED t1 index NULL groups_20 5 NULL 20000 Using index; Using join buffer (flat, BNL join) select @@ -147,32 +90,7 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) -[ - { - "join_output_cardinality": 200000, - "estimation": - [ - { - "table": "t1", - "steps": - [ - { - "index_name": "groups_20", - "cardinality": 20.99999895 - } - ], - "cardinality": 20.99999895 - }, - { - "table": "t3", - "steps": - [], - "cardinality": 10 - } - ], - "post_group_cardinality": 209.9999895 - } -] +NULL # Now, without an index explain select * @@ -189,25 +107,6 @@ from information_schema.optimizer_trace; json_detailed(json_extract(trace, '$**.materialized_output_cardinality')) -[ - { - "join_output_cardinality": 200000, - "estimation": - [ - { - "table": "t1", - "steps": - [ - { - "column": "groups_20", - "cardinality": 20.99999895 - } - ], - "cardinality": 20.99999895 - } - ], - "post_group_cardinality": 20.99999895 - } -] +NULL set optimizer_trace=default; drop table t1, t2, t3; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_by_cardinality/' main.information_schema_tables [ pass ] 210 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'INSERT INTO' ReplayTest: Failed query was: EXPLAIN INSERT INTO t1(id1,val1) VALUES (8,'i') RETURNING * ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO t1(id1,val1) VALUES(9,'j') RETURNING id1 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN FORMAT="json" INSERT INTO t1(id1,val1) VALUES (10,'k') RETURNING id1 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: EXPLAIN INSERT INTO t1 VALUES(15,'q'),(16,'r') RETURNING * ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO t1 VALUES (17,'s'),(18,'t') RETURNING * ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN FORMAT="json" INSERT INTO t1 VALUES(19,'u'),(20,'v') RETURNING id1 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist ReplayTest: Failed query was: EXPLAIN INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='h' RETURNING val ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='i' RETURNING val ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist ReplayTest: Failed query was: EXPLAIN FORMAT="json" INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='j' RETURNING val ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN INSERT INTO t1 SET id1=9, val1='i' RETURNING id1 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'val1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO t1 SET id1=10, val1='j' RETURNING val1 ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'val1' in 'RETURNING' ReplayTest: Failed query was: EXPLAIN FORMAT="json" INSERT INTO t1 SET id1=11, val1='k' RETURNING val1 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.insert_returning [ fail ] Test ended at 2026-04-23 23:15:17 CURRENT_TEST: main.insert_returning --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_returning.result 2026-04-02 14:38:09.380657583 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_returning.reject 2026-04-23 23:15:17.398282682 +0300 @@ -58,23 +58,11 @@ 6 f 7 h EXPLAIN INSERT INTO t1(id1,val1) VALUES (8,'i') RETURNING *; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'INSERT INTO' EXPLAIN EXTENDED INSERT INTO t1(id1,val1) VALUES(9,'j') RETURNING id1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`t1`(id1,val1) values (9,'j') +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' EXPLAIN FORMAT="json" INSERT INTO t1(id1,val1) VALUES (10,'k') RETURNING id1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' SELECT * FROM t1; id1 val1 1 a @@ -148,23 +136,11 @@ 13 o 14 p EXPLAIN INSERT INTO t1 VALUES(15,'q'),(16,'r') RETURNING *; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 EXPLAIN EXTENDED INSERT INTO t1 VALUES (17,'s'),(18,'t') RETURNING *; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`t1` values (17,'s'),(18,'t') +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 EXPLAIN FORMAT="json" INSERT INTO t1 VALUES(19,'u'),(20,'v') RETURNING id1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' SELECT * FROM t1; id1 val1 1 a @@ -234,25 +210,13 @@ 4 EXPLAIN INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='h' RETURNING val; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT ins_duplicate ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist EXPLAIN EXTENDED INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='i' RETURNING val; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT ins_duplicate ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`ins_duplicate`(id,val) values (2,'b') on duplicate key update `test`.`ins_duplicate`.`val` = 'i' +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist EXPLAIN FORMAT="json" INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY UPDATE val='j' RETURNING val; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "ins_duplicate" - } - } -} +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.ins_duplicate' doesn't exist INSERT INTO v1(id1, val1) VALUES (2,'d') ON DUPLICATE KEY UPDATE val1='d' RETURNING id1+id1 AS total, val1, id1 && id1, id1|id1, UPPER(val1), f(id1); @@ -321,23 +285,11 @@ Warnings: Warning 1062 Duplicate entry '8' for key 'PRIMARY' EXPLAIN INSERT INTO t1 SET id1=9, val1='i' RETURNING id1; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'id1' in 'RETURNING' EXPLAIN EXTENDED INSERT INTO t1 SET id1=10, val1='j' RETURNING val1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`t1`(id1,val1) values (10,'j') +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'val1' in 'RETURNING' EXPLAIN FORMAT="json" INSERT INTO t1 SET id1=11, val1='k' RETURNING val1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} +ReplayTest: Direct EXPLAIN failed on replay server: 1054 Unknown column 'val1' in 'RETURNING' INSERT INTO v1 SET id1=26, val1='Z' RETURNING id1+id1 AS total,val1, id1 && id1, id1|id1, UPPER(val1),f(id1); total val1 id1 && id1 id1|id1 UPPER(val1) f(id1) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.insert_returning/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 [ fail ] Test ended at 2026-04-23 23:15:19 CURRENT_TEST: main.join --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join.result 2026-04-02 14:38:09.382657578 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join.reject 2026-04-23 23:15:19.247424720 +0300 @@ -862,14 +862,14 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 9 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 5 +Handler_read_rnd_next 7 drop table t1, t2, t3; create table t1 (a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -892,7 +892,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.011600 +Last_query_cost 0.024323 select 'The cost of accessing t1 (dont care if it changes' '^'; The cost of accessing t1 (dont care if it changes^ The cost of accessing t1 (dont care if it changes^ @@ -910,7 +910,7 @@ 1 SIMPLE B eq_ref PRIMARY PRIMARY 4 test.A.b 1 show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 0.046590 +Last_query_cost 0.024323 select '^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error' Z; Z ^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.join_cache_cardinality [ fail ] Test ended at 2026-04-23 23:15:19 CURRENT_TEST: main.join_cache_cardinality --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache_cardinality.result 2026-04-02 14:38:09.384657572 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache_cardinality.reject 2026-04-23 23:15:19.748244943 +0300 @@ -20,30 +20,11 @@ set @json= (select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; JS -[ - { - "hash_join_columns": - [ - { - "field": "a", - "avg_frequency": 1 - }, - { - "field": "b", - "avg_frequency": 2 - }, - { - "field": "c", - "avg_frequency": 3.9216 - } - ], - "rows": 1 - } -] +NULL select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) as ROWS_FOR_PLAN; ROWS_FOR_PLAN -[100] +NULL explain select * from t1, t2 where t1.c=t2.c; id select_type table type possible_keys key key_len ref rows Extra @@ -52,22 +33,11 @@ set @json= (select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; JS -[ - { - "hash_join_columns": - [ - { - "field": "c", - "avg_frequency": 3.9216 - } - ], - "rows": 3.9216 - } -] +NULL select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) as ROWS_FOR_PLAN; ROWS_FOR_PLAN -[392.16] +NULL explain select * from t1 straight_join t2 where t1.c=t2.c and t2.a<30; id select_type table type possible_keys key key_len ref rows Extra @@ -77,29 +47,9 @@ # Note that rows is the same: select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; JS -[ - { - "hash_join_columns": - [ - { - "field": "c", - "avg_frequency": 3.9216 - } - ], - "rows": 0.568632 - } -] +NULL # Despite available selectivity: select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS; JS -[ - [ - { - "column_name": "a", - "ranges": - ["NULL < a < 30"], - "selectivity_from_histogram": 0.145 - } - ] -] +NULL drop table t1,t2; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache_cardinality/' main.join_cache_debug [ pass ] 552 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_nested [ pass ] 314 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_nested_jcl6 [ pass ] 319 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Table 'seq_1_to_10' already exists ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/key.test" ReplayTest: At line 632 main.key [ fail ] Test ended at 2026-04-23 23:15:24 CURRENT_TEST: main.key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/key.result 2026-04-02 14:38:09.387657564 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/key.reject 2026-04-23 23:15:24.631167820 +0300 @@ -497,7 +497,7 @@ ALTER TABLE t1 DISABLE KEYS; EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1; CREATE TABLE t1 ( a INTEGER auto_increment PRIMARY KEY, @@ -631,19 +631,19 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 0.014784 +Last_query_cost 0.024323 EXPLAIN SELECT a, SUM( b ) FROM t1 USE INDEX( a ) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 0.014784 +Last_query_cost 0.024323 EXPLAIN SELECT a, SUM( b ) FROM t1 FORCE INDEX( a ) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 0.014784 +Last_query_cost 0.024323 DROP TABLE t1; # # MDEV-21480: Unique key using ref access though eq_ref access can be used @@ -727,7 +727,4 @@ sum(a+b) 10100 explain select straight_join sum(a+b) from seq_1_to_10 as s, t1 force index (k2) where t1.a=s.seq; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index PRIMARY PRIMARY 8 NULL 10 Using index -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where; Using join buffer (flat, BNL join) drop table t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.key/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.log_slow_debug [ pass ] 174 main.max_session_mem_used [ pass ] 25 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1471 The target table v1 of the INSERT is not insertable-into ReplayTest: Failed query was: EXPLAIN INSERT INTO v1 VALUES (10) ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1471 The target table v1 of the INSERT is not insertable-into ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO v1 VALUES (10) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: EXPLAIN INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); ReplayTest: Loading context ReplayTest: Loading context main.myisam_explain_non_select_all [ fail ] Test ended at 2026-04-23 23:15:30 CURRENT_TEST: main.myisam_explain_non_select_all --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/myisam_explain_non_select_all.result 2026-04-17 18:40:40.441798810 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/myisam_explain_non_select_all.reject 2026-04-23 23:15:29.877406934 +0300 @@ -19,7 +19,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 10; @@ -29,7 +30,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -60,7 +62,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 10; @@ -70,7 +73,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -101,7 +105,8 @@ Note 1003 delete from `test`.`t1` using `test`.`t1` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1; @@ -111,7 +116,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -146,7 +152,8 @@ Note 1003 update `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE t1.a = 1; @@ -157,7 +164,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -194,7 +202,8 @@ Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 t11, (SELECT * FROM t2) t12 WHERE t11.a = 1; @@ -205,7 +214,8 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where `test`.`t11`.`a` = 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -240,7 +250,8 @@ Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3); @@ -251,7 +262,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -288,7 +300,8 @@ Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3); @@ -300,7 +313,8 @@ 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 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -342,7 +356,8 @@ Note 1003 update `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t3`.`b` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3); @@ -355,7 +370,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` where `test`.`t3`.`b` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 9 @@ -392,7 +408,8 @@ Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 t11, (SELECT * FROM t2) t12; @@ -403,7 +420,8 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -442,8 +460,8 @@ Note 1003 /* select#1 */ update `test`.`t1` `t11` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 -Handler_read_rnd_next 1 +Handler_read_key 4 +Handler_read_rnd_next 3 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 t11, (SELECT 1 FROM DUAL) t12; @@ -455,8 +473,8 @@ Note 1003 /* select#1 */ select `test`.`t11`.`a` AS `a`,1 AS `1` from `test`.`t1` `t11` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 -Handler_read_rnd_next 1 +Handler_read_key 4 +Handler_read_rnd_next 3 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -494,7 +512,8 @@ Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` > 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 t11, (SELECT * FROM t2) t12 WHERE t11.a > 1; @@ -505,7 +524,8 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` `t11` join `test`.`t2` where `test`.`t11`.`a` > 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -536,7 +556,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 1 limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 1 LIMIT 1; @@ -546,7 +567,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1 limit 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -577,7 +599,8 @@ Note 1003 delete from `test`.`t1` using dual where 0 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE 0; @@ -587,7 +610,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -615,7 +639,8 @@ Note 1003 delete from `test`.`t1` using `test`.`t1` where 0 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE 0; @@ -625,7 +650,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -653,7 +679,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` = 3 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 5 +Handler_read_key 10 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 3; @@ -663,7 +690,8 @@ Note 1003 select 3 AS `a`,3 AS `b` from `test`.`t1` where 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 11 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -692,7 +720,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 5 +Handler_read_key 10 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a < 3; @@ -702,7 +731,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 5 +Handler_read_key 10 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -729,7 +759,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a; @@ -739,8 +770,8 @@ Note 1003 select NULL AS `a` from `test`.`t1` where 0 order by NULL # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 -Handler_read_rnd_next 1 +Handler_read_key 6 +Handler_read_rnd_next 3 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 3 @@ -766,7 +797,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a; @@ -776,7 +808,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -807,7 +840,8 @@ Note 1003 delete from `test`.`t1` using dual where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1; @@ -817,7 +851,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -849,7 +884,8 @@ Note 1003 delete from `test`.`t1` using dual order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 7 +Handler_read_key 14 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 ORDER BY a ASC, b ASC LIMIT 1; @@ -859,7 +895,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 7 +Handler_read_key 14 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -904,7 +941,8 @@ Note 1003 delete from `test`.`t1`,`test`.`t2`,`test`.`t3` using `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a2` = `test`.`t1`.`a1` and `test`.`t3`.`a3` = `test`.`t2`.`b2` and `test`.`t3`.`b3` = `test`.`t1`.`b1` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 13 +Handler_read_key 26 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1,t2,t3 WHERE a1=a2 AND b2=a3 AND b1=b3; @@ -916,7 +954,8 @@ Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`b3` AS `b3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a2` = `test`.`t1`.`a1` and `test`.`t3`.`a3` = `test`.`t2`.`b2` and `test`.`t3`.`b3` = `test`.`t1`.`b1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 13 +Handler_read_key 26 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 19 @@ -955,7 +994,8 @@ Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`a` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT a FROM t2); @@ -966,7 +1006,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -1002,7 +1043,8 @@ Note 1003 /* select#1 */ delete from `test`.`t1` using dual where (`test`.`t1`.`a1`,(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and (`test`.`t1`.`a1`) = `test`.`t2`.`a2`)) # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2); @@ -1013,7 +1055,8 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1` from `test`.`t1` where <`test`.`t1`.`a1`>((`test`.`t1`.`a1`,(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and (`test`.`t1`.`a1`) = `test`.`t2`.`a2`))) # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 9 @@ -1045,7 +1088,8 @@ Note 1003 delete from `test`.`t1` using (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2); @@ -1056,7 +1100,8 @@ Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -1087,7 +1132,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`i` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -1097,7 +1143,8 @@ Note 1003 select `test`.`t1`.`i` AS `i`,`test`.`t1`.`j` AS `j` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 3 @@ -1118,17 +1165,18 @@ # EXPLAIN DELETE FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL 5 Deleting all rows +1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL 5 NULL Deleting all rows +1 SIMPLE NULL NULL NULL NULL NULL NULL 0 NULL Deleting all rows Warnings: Note 1003 delete from `test`.`t1` using dual # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -1138,7 +1186,8 @@ Note 1003 select `test`.`t1`.`i` AS `i`,`test`.`t1`.`j` AS `j` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 3 @@ -1172,7 +1221,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -1182,7 +1232,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -1216,7 +1267,8 @@ Note 1003 insert into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -1226,7 +1278,8 @@ Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -1248,17 +1301,18 @@ # EXPLAIN REPLACE INTO t2 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED REPLACE INTO t2 SELECT * FROM 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 t1 system NULL NULL NULL NULL 0 0.00 Const row not found Warnings: -Note 1003 replace into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1` +Note 1003 replace into `test`.`t2` select NULL AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 +Handler_read_rnd_next 1 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -1268,7 +1322,8 @@ Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -1299,6 +1354,7 @@ # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 +Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value Handler_read_key 2 @@ -1324,6 +1380,7 @@ # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 +Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value Handler_read_key 2 @@ -1351,7 +1408,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; @@ -1361,7 +1419,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 5 @@ -1399,7 +1458,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; @@ -1413,7 +1473,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -1460,7 +1521,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` >= 10 and `test`.`t1`.`i` < 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5; @@ -1474,7 +1536,8 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1` where `test`.`t1`.`i` >= 10 and `test`.`t1`.`i` < 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -1515,7 +1578,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -1525,7 +1589,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -1563,7 +1628,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -1573,7 +1639,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -1613,7 +1680,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -1624,7 +1692,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -1669,7 +1738,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -1680,7 +1750,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -1723,7 +1794,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; @@ -1733,7 +1805,8 @@ Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -1774,7 +1847,8 @@ Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5; @@ -1784,7 +1858,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 5 @@ -1819,7 +1894,8 @@ Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 ORDER BY a, b DESC LIMIT 5; @@ -1829,7 +1905,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -1871,7 +1948,8 @@ Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 ORDER BY a DESC, b DESC LIMIT 5; @@ -1881,7 +1959,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -1918,7 +1997,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; @@ -1928,7 +2008,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 5 @@ -1969,7 +2050,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; @@ -1983,7 +2065,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -2025,7 +2108,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -2035,7 +2119,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -2074,7 +2159,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -2084,7 +2170,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -2125,7 +2212,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -2136,7 +2224,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -2181,7 +2270,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; @@ -2192,7 +2282,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 8 +Handler_read_key 16 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -2235,7 +2326,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`i` = 123 where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; @@ -2245,7 +2337,8 @@ Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`.`key2` AS `key2` from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 8 @@ -2286,7 +2379,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5; @@ -2296,7 +2390,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 5 @@ -2332,7 +2427,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 ORDER BY a, b DESC LIMIT 5; @@ -2342,7 +2438,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -2385,7 +2482,8 @@ Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2 ORDER BY a DESC, b DESC LIMIT 5; @@ -2395,7 +2493,8 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 6 @@ -2435,7 +2534,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`c2` = 0 where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; @@ -2445,7 +2545,8 @@ Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -2479,7 +2580,8 @@ Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; @@ -2489,7 +2591,8 @@ Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -2526,7 +2629,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 10 where `test`.`t1`.`a` > 34 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 34; @@ -2536,7 +2640,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 34 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -2571,8 +2676,8 @@ Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 7 -Handler_read_rnd_next 1 +Handler_read_key 14 +Handler_read_rnd_next 3 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; @@ -2583,8 +2688,8 @@ Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`c3` AS `c3`,NULL AS `c1`,NULL AS `c2` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 7 -Handler_read_rnd_next 1 +Handler_read_key 14 +Handler_read_rnd_next 3 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -2612,8 +2717,8 @@ Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 7 -Handler_read_rnd_next 1 +Handler_read_key 14 +Handler_read_rnd_next 3 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c3 = 10; @@ -2624,8 +2729,8 @@ Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`c3` AS `c3`,NULL AS `c1`,NULL AS `c2` from `test`.`t1` where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 7 -Handler_read_rnd_next 1 +Handler_read_key 14 +Handler_read_rnd_next 3 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -2661,7 +2766,8 @@ Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`f2` = (/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`) # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 7 +Handler_read_key 14 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT (SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1) FROM t1; @@ -2673,7 +2779,8 @@ Note 1003 /* select#1 */ select <`test`.`t1`.`f1`>((/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`)) AS `(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1)` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 7 +Handler_read_key 14 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 11 @@ -2729,10 +2836,11 @@ 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 update `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` > 0 +Note 1003 update `test`.`t1` `t11` join `test`.`t1` `t12` set `t11`.`a` = 1 where `t11`.`a` > 0 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM v1 WHERE a > 0; @@ -2740,10 +2848,11 @@ 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` `t11` join `test`.`t1` `t12` where `test`.`t11`.`a` > 0 +Note 1003 select `t11`.`a` AS `a`,`t12`.`a` AS `b` from `test`.`t1` `t11` join `test`.`t1` `t12` where `t11`.`a` > 0 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -2772,10 +2881,11 @@ 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 update `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` = `test`.`t1`.`a` +Note 1003 update `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` set `t11`.`a` = 1 where `t11`.`a` = `t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1, v1 WHERE t1.a = v1.a; @@ -2784,10 +2894,11 @@ 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` where `test`.`t11`.`a` = `test`.`t1`.`a` +Note 1003 select `t1`.`a` AS `a`,`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` where `t11`.`a` = `t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 +Handler_read_key 4 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -2822,7 +2933,8 @@ Note 1003 /* select#1 */ delete from `test`.`t1` using dual where `v1`.`a` < 4 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM v1 WHERE a < 4; @@ -2832,7 +2944,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 4 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_first 1 @@ -2871,7 +2984,8 @@ Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2, v1 WHERE t2.x = v1.a; @@ -2882,7 +2996,8 @@ Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` + 1 AS `c` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 10 @@ -2920,7 +3035,8 @@ Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t2, v1 WHERE t2.x = v1.a; @@ -2931,7 +3047,8 @@ Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` + 1 AS `c` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 6 +Handler_read_key 12 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 10 @@ -2953,18 +3070,15 @@ # select: SELECT NULL # EXPLAIN INSERT INTO v1 VALUES (10); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1471 The target table v1 of the INSERT is not insertable-into FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO v1 VALUES (10); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`t1`(x) values (10) +ReplayTest: Direct EXPLAIN failed on replay server: 1471 The target table v1 of the INSERT is not insertable-into # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 +Handler_read_rnd_next 1 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT NULL; @@ -2974,6 +3088,7 @@ Note 1003 select NULL AS `NULL` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value +Handler_read_rnd_next 1 # Status of "equivalent" SELECT query execution: Variable_name Value # Status of testing query execution: @@ -3004,8 +3119,8 @@ Note 1003 insert into `test`.`t2`(x) /* select#1 */ select NULL AS `a` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 -Handler_read_rnd_next 1 +Handler_read_key 8 +Handler_read_rnd_next 3 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -3015,8 +3130,8 @@ Note 1003 select NULL AS `a` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 2 -Handler_read_rnd_next 1 +Handler_read_key 4 +Handler_read_rnd_next 3 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 2 @@ -3059,7 +3174,8 @@ Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x); @@ -3071,7 +3187,8 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -3110,7 +3227,8 @@ Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x); @@ -3123,7 +3241,8 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -3163,7 +3282,8 @@ Note 1003 /* select#1 */ update (/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `y` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1, (SELECT * FROM t2) y WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x); @@ -3176,7 +3296,8 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from (/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` where `x`.`b` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 4 +Handler_read_key 8 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 7 @@ -3239,7 +3360,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT a t1 FROM t1 WHERE a>10; @@ -3249,7 +3371,8 @@ Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a` > 10 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -3274,7 +3397,8 @@ Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10 order by `test`.`t1`.`a` + 20 # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT a t1 FROM t1 WHERE a>10 ORDER BY a+20; @@ -3284,7 +3408,8 @@ Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a` > 10 order by `test`.`t1`.`a` + 20 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value -Handler_read_key 3 +Handler_read_key 6 +Handler_read_rnd_next 2 # Status of "equivalent" SELECT query execution: Variable_name Value Handler_read_key 4 @@ -3302,18 +3427,15 @@ # select: # EXPLAIN INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Note 1003 insert into `test`.`t1` values (3,10),(7,11),(3,11) on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`) +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 +Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value Handler_read_key 4 @@ -3341,7 +3463,8 @@ Note 1003 insert into `test`.`t1` select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`) # Status of EXPLAIN EXTENDED query Variable_name Value -Handler_read_key 7 +Handler_read_key 14 +Handler_read_rnd_next 2 # Status of testing query execution: Variable_name Value Handler_read_key 7 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.myisam_explain_non_select_all/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.myisam_icp [ pass ] 349 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.myisam_mrr '64bit' [ pass ] 247 main.natural_sort_key [ pass ] 507 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.null_aware_cardinality [ pass ] 103 ReplayTest: Loading context main.opt_context_load_stats_basic [ fail ] Test ended at 2026-04-23 23:15:36 CURRENT_TEST: main.opt_context_load_stats_basic --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_load_stats_basic.result 2026-04-20 14:31:43.587622035 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_load_stats_basic.reject 2026-04-23 23:15:36.048994090 +0300 @@ -448,51 +448,51 @@ select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "key_number" element not present at offset 535. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].num_records'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "num_records" element not present at offset 534. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].eq_ref'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "eq_ref" element not present at offset 539. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].index_cost_io'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "index_cost_io" element not present at offset 532. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].index_cost_cpu'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "index_cost_cpu" element not present at offset 521. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].row_cost_io'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "row_cost_io" element not present at offset 534. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].row_cost_cpu'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "row_cost_cpu" element not present at offset 523. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].max_index_blocks'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "max_index_blocks" element not present at offset 529. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].max_row_blocks'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "max_row_blocks" element not present at offset 531. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. set @opt_context=json_remove(@saved_opt_context_1, '$.list_contexts[0].list_index_read_costs[0].copy_cost'); select * from t1 where a > 10; a b Warnings: -Warning 4253 Failed to parse saved optimizer context: "copy_cost" element not present at offset 536. +Warning 4253 Failed to parse saved optimizer context: at offset 774306305. drop table t1; drop database db1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_context_load_stats_basic/' ReplayTest: Loading context main.opt_context_store_stats [ fail ] Test ended at 2026-04-23 23:15:36 CURRENT_TEST: main.opt_context_store_stats --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_store_stats.result 2026-04-17 18:40:40.452799489 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_store_stats.reject 2026-04-23 23:15:36.578986254 +0300 @@ -746,9 +746,7 @@ ); select @const_table_inserts; @const_table_inserts -REPLACE INTO db1.t0(a, b) VALUES (1, 'aaa\'bbb'); - - +NULL drop table t1; drop table t0; drop database db1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_context_store_stats/' ReplayTest: Loading context main.opt_hint_timeout [ pass ] 1009 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: EXPLAIN EXTENDED INSERT /*+ test */ INTO t1 VALUES (10, 10) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints [ fail ] Test ended at 2026-04-23 23:15:39 CURRENT_TEST: main.opt_hints --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints.result 2026-04-17 18:40:40.453799551 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints.reject 2026-04-23 23:15:38.863952653 +0300 @@ -156,34 +156,38 @@ EXPLAIN EXTENDED SELECT /*+ NO_RANGE_OPTIMIZATION(таблица PRIMARY) */ f1 FROM таблица WHERE f1 > 30 AND f1 < 33; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE таблица range PRIMARY,f2_индекс f2_индекс 4 NULL 2 100.00 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) */ `test`.`таблица`.`f1` AS `f1` from `test`.`таблица` where `test`.`таблица`.`f1` > 30 and `test`.`таблица`.`f1` < 33 +Warning 4253 Failed to parse saved optimizer context: un-escaping error of name element at offset 65. +Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) */ NULL AS `f1` from `test`.`таблица` where 0 # Turn off range access for PRIMARY & f2_индекс keys # Should use index access EXPLAIN EXTENDED SELECT /*+ NO_RANGE_OPTIMIZATION(таблица PRIMARY, f2_индекс) */ f1 FROM таблица WHERE f1 > 30 AND f1 < 33; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE таблица index PRIMARY,f2_индекс PRIMARY 4 NULL 56 4.11 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `f2_индекс`) */ `test`.`таблица`.`f1` AS `f1` from `test`.`таблица` where `test`.`таблица`.`f1` > 30 and `test`.`таблица`.`f1` < 33 +Warning 4253 Failed to parse saved optimizer context: un-escaping error of name element at offset 65. +Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `f2_индекс`) */ NULL AS `f1` from `test`.`таблица` where 0 # Turn off range access for all keys # Should use index access EXPLAIN EXTENDED SELECT /*+ NO_RANGE_OPTIMIZATION(таблица) */ f1 FROM таблица WHERE f1 > 30 AND f1 < 33; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE таблица index PRIMARY,f2_индекс PRIMARY 4 NULL 56 4.11 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1`) */ `test`.`таблица`.`f1` AS `f1` from `test`.`таблица` where `test`.`таблица`.`f1` > 30 and `test`.`таблица`.`f1` < 33 +Warning 4253 Failed to parse saved optimizer context: un-escaping error of name element at offset 65. +Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1`) */ NULL AS `f1` from `test`.`таблица` where 0 # Turn off range access for PRIMARY & f2_индекс keys # Should use index access EXPLAIN EXTENDED SELECT /*+ NO_RANGE_OPTIMIZATION(таблица PRIMARY) NO_RANGE_OPTIMIZATION(таблица f2_индекс) */ f1 FROM таблица WHERE f1 > 30 AND f1 < 33; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE таблица index PRIMARY,f2_индекс PRIMARY 4 NULL 56 4.11 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `f2_индекс`) */ `test`.`таблица`.`f1` AS `f1` from `test`.`таблица` where `test`.`таблица`.`f1` > 30 and `test`.`таблица`.`f1` < 33 +Warning 4253 Failed to parse saved optimizer context: un-escaping error of name element at offset 65. +Note 1003 select /*+ NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `PRIMARY`) NO_RANGE_OPTIMIZATION(`таблица`@`select#1` `f2_индекс`) */ NULL AS `f1` from `test`.`таблица` where 0 DROP TABLE таблица; # NO_ICP hint testing set optimizer_switch='index_condition_pushdown=on'; @@ -511,37 +515,33 @@ EXPLAIN EXTENDED REPLACE INTO t3(f1, f2, f3) (SELECT t4.x, t5.y, 'filler' FROM t4, t4 t5 WHERE t4.y = 8 AND t5.x BETWEEN 7 AND t4.y+0); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00 -1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using index condition; Using where; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 (replace into `test`.`t3`(f1,f2,f3) select `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and (8 + 0)) +Note 1003 (replace into `test`.`t3`(f1,f2,f3) select NULL AS `x`,NULL AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where 0) # Turn off ICP. ICP should not be used. EXPLAIN EXTENDED REPLACE INTO t3(f1, f2, f3) (SELECT /*+ NO_ICP(t5) */t4.x, t5.y, 'filler' FROM t4, t4 t5 WHERE t4.y = 8 AND t5.x BETWEEN 7 AND t4.y+0); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00 -1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ NO_ICP(`t5`@`select#1`) */ `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and (8 + 0)) +Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ NO_ICP(`t5`@`select#1`) */ NULL AS `x`,NULL AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where 0) # Turn off ICP for a particular table EXPLAIN EXTENDED REPLACE INTO t3(f1, f2, f3) (SELECT /*+ QB_NAME(qb1) NO_ICP(t5@QB1)*/ t4.x, t5.y, 'filler' FROM t4, t4 t5 WHERE t4.y = 8 AND t5.x BETWEEN 7 AND t4.y+0); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00 -1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ QB_NAME(`qb1`) NO_ICP(`t5`@`qb1`) */ `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and (8 + 0)) +Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ QB_NAME(`qb1`) NO_ICP(`t5`@`qb1`) */ NULL AS `x`,NULL AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where 0) # Turn off ICP for a particular table and a key EXPLAIN EXTENDED REPLACE INTO t3(f1, f2, f3) (SELECT /*+ NO_ICP(t5 x_idx) */ t4.x, t5.y, 'filler' FROM t4, t4 t5 WHERE t4.y = 8 AND t5.x BETWEEN 7 AND t4.y+0); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00 -1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ NO_ICP(`t5`@`select#1` `x_idx`) */ `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and (8 + 0)) +Note 1003 (replace into `test`.`t3`(f1,f2,f3) select /*+ NO_ICP(`t5`@`select#1` `x_idx`) */ NULL AS `x`,NULL AS `y`,'filler' AS `filler` from `test`.`t4` join `test`.`t4` `t5` where 0) # Misc tests # Should issue warning EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) QB_NAME(qb1 ) */ * FROM t2; @@ -1116,11 +1116,7 @@ Warning 1064 Optimizer hint syntax error near 'test */ 1' at line 1 Note 1003 select 1 AS `1` EXPLAIN EXTENDED INSERT /*+ test */ INTO t1 VALUES (10, 10); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL -Warnings: -Warning 1064 Optimizer hint syntax error near 'test */ INTO t1 VALUES (10, 10)' at line 1 -Note 1003 insert into `test`.`t1` values (10,10) +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 EXPLAIN EXTENDED UPDATE /*+ test */ t1 SET i = 10 WHERE j = 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 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_hints/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_derived_condition_pushdown [ pass ] 295 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_merge [ pass ] 199 main.opt_trace_selectivity [ pass ] 286 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_tvc [ fail ] Test ended at 2026-04-23 23:15:41 CURRENT_TEST: main.opt_tvc --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_tvc.result 2026-04-17 18:40:40.460799984 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_tvc.reject 2026-04-23 23:15:41.253917894 +0300 @@ -46,11 +46,9 @@ 2 5 explain extended select * from t1 where a in (1,2); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2) explain extended select * from t1 where a in ( @@ -84,11 +82,9 @@ 7 8 explain extended select * from t1 where a in (1,2,2,2,3,4,5,6,7); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2),(2),(2),(3),(4),(5),(6),(7)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2,2,2,3,4,5,6,7) explain extended select * from t1 where a in ( @@ -126,13 +122,9 @@ where a in (1,2) and b in (1,5); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00 -5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(5)) `tvc_1` join (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` and `tvc_1`.`_col_1` = `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2) and `test`.`t1`.`b` in (1,5) explain extended select * from t1 where a in ( @@ -181,12 +173,9 @@ ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED eq_ref distinct_key distinct_key 4 test.t2.b 1 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 PRIMARY t2 ALL NULL NULL NULL NULL 6 16.67 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `tvc_0`.`_col_1` = `test`.`t2`.`b` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` in (3,4) explain extended select * from t1 where a in ( @@ -238,11 +227,9 @@ where a in (1,2) ) as dr_table; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2) explain extended select * from ( select * @@ -295,11 +282,9 @@ ) select * from tvc_0; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 with tvc_0 as (/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (dual) join `test`.`t1` where `test`.`t1`.`a` in (1,2))/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 with tvc_0 as (select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2))select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2) explain extended select * from ( select * @@ -344,11 +329,9 @@ 2 5 explain extended select * from v1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` in (1,2) explain extended select * from v2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where @@ -407,12 +390,9 @@ ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 PRIMARY t1 ALL NULL NULL NULL NULL 6 16.67 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `tvc_0`.`_col_1` = `test`.`t1`.`a` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t1`) where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` in (1,2) explain extended select * from t1 where a in ( @@ -472,10 +452,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY ALL NULL NULL NULL NULL 6 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort -2 DERIVED eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from (values (3),(5)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`b` group by `test`.`t1`.`b`) `dr_table` +Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` in (3,5) group by `test`.`t1`.`b`) `dr_table` explain extended select * from ( select max(a),b @@ -530,11 +508,10 @@ 4 yq explain extended select * from t3 where a in (1,4); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL distinct_key NULL NULL NULL 2 100.00 -1 PRIMARY t3 ref idx idx 5 tvc_0._col_1 3 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t3 range idx idx 5 NULL 2 100.00 Using index condition Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from (values (1),(4)) `tvc_0` join `test`.`t3` where `test`.`t3`.`a` = `tvc_0`.`_col_1` +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t3.idx doesn't exist in list of range contexts +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t3` where `test`.`t3`.`a` in (1,4) # use vectors in IN predicate set @@in_predicate_conversion_threshold= 4; select * from t1 where (a,b) in ((1,2),(3,4)); @@ -542,11 +519,9 @@ 1 2 explain extended select * from t1 where (a,b) in ((1,2),(3,4)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1,2),(3,4)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` and `tvc_0`.`_col_2` = `test`.`t1`.`b` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a`,`test`.`t1`.`b`) in (((1,2)),((3,4))) set @@in_predicate_conversion_threshold= 2; # transformation works for the one IN predicate and doesn't work for the other set @@in_predicate_conversion_threshold= 5; @@ -560,11 +535,9 @@ where (a,b) in ((1,2),(8,9)) and (a,c) in ((1,3),(8,0),(5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t2.a,test.t2.c 1 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from (values (1,3),(8,0),(5,1)) `tvc_0` join `test`.`t2` where `tvc_0`.`_col_1` = `test`.`t2`.`a` and `tvc_0`.`_col_2` = `test`.`t2`.`c` and (`test`.`t2`.`a`,`test`.`t2`.`b`) in (((1,2)),((8,9))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a`,`test`.`t2`.`b`) in (((1,2)),((8,9))) and (`test`.`t2`.`a`,`test`.`t2`.`c`) in (((1,3)),((8,0)),((5,1))) set @@in_predicate_conversion_threshold= 2; # # mdev-14281: conversion of NOT IN predicate into subquery predicate @@ -588,11 +561,9 @@ explain extended select * from t1 where (a,b) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 DEPENDENT SUBQUERY unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<`test`.`t1`.`a`,`test`.`t1`.`b`>(((`test`.`t1`.`a`,`test`.`t1`.`b`),(((`test`.`t1`.`a`) in on distinct_key where trigcond((`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond((`test`.`t1`.`b`) = `tvc_0`.`_col_2`))))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a`,`test`.`t1`.`b`) not in (((1,2)),((8,9)),((5,1))) explain extended select * from t1 where (a,b) not in (select * from (values (1,2),(8,9), (5,1)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -610,11 +581,9 @@ explain extended select * from t1 where b < 7 and (a,b) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 DEPENDENT SUBQUERY unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and !<`test`.`t1`.`a`,`test`.`t1`.`b`>(((`test`.`t1`.`a`,`test`.`t1`.`b`),(((`test`.`t1`.`a`) in on distinct_key where trigcond((`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond((`test`.`t1`.`b`) = `tvc_0`.`_col_2`))))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and (`test`.`t1`.`a`,`test`.`t1`.`b`) not in (((1,2)),((8,9)),((5,1))) select * from t2 where (a,c) not in ((1,2),(8,9), (5,1)); a b c @@ -626,11 +595,9 @@ explain extended select * from t2 where (a,c) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where -2 DEPENDENT SUBQUERY unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE t2 ALL NULL NULL NULL NULL 6 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<`test`.`t2`.`a`,`test`.`t2`.`c`>(((`test`.`t2`.`a`,`test`.`t2`.`c`),(((`test`.`t2`.`a`) in on distinct_key where trigcond((`test`.`t2`.`a`) = `tvc_0`.`_col_1`) and trigcond((`test`.`t2`.`c`) = `tvc_0`.`_col_2`))))) +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a`,`test`.`t2`.`c`) not in (((1,2)),((8,9)),((5,1))) drop table t1, t2, t3; set @@in_predicate_conversion_threshold= default; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_tvc/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.order_by_limit_join [ fail ] Test ended at 2026-04-23 23:15:42 CURRENT_TEST: main.order_by_limit_join --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by_limit_join.result 2026-04-02 14:38:09.422657470 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by_limit_join.reject 2026-04-23 23:15:41.883908792 +0300 @@ -70,54 +70,7 @@ set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; JS -[ - { - "limit_fraction": 0.001, - "test_if_skip_sort_order_early": - [ - { - "reconsidering_access_paths_for_index_ordering": - { - "clause": "ORDER BY", - "table": "t1", - "rows_estimation": 10000, - "filesort_cost": "REPLACED", - "read_cost": "REPLACED", - "filesort_type": "priority_queue with row lookup", - "fanout": 1, - "possible_keys": - [ - { - "index": "a", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "b", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "col1", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 10, - "range_scan": false, - "scan_cost": "REPLACED", - "chosen": true - } - ] - } - } - ], - "can_skip_filesort": true, - "full_join_cost": "REPLACED", - "risk_ratio": 10, - "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 0.495218616, - "use_shortcut_cost": true - } -] +NULL # # Query 2 - same as above but without a suitable index. # @@ -157,19 +110,7 @@ set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; JS -[ - { - "limit_fraction": 0.001, - "test_if_skip_sort_order_early": - [], - "can_skip_filesort": false, - "full_join_cost": "REPLACED", - "risk_ratio": 10, - "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 16.2273863, - "use_shortcut_cost": true - } -] +NULL # # Query 3: Counter example with large limit # @@ -209,55 +150,7 @@ set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; JS -[ - { - "limit_fraction": 0.5, - "test_if_skip_sort_order_early": - [ - { - "reconsidering_access_paths_for_index_ordering": - { - "clause": "ORDER BY", - "table": "t1", - "rows_estimation": 10000, - "filesort_cost": "REPLACED", - "read_cost": "REPLACED", - "filesort_type": "merge_sort with addon fields", - "fanout": 1, - "possible_keys": - [ - { - "index": "a", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "b", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "col1", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 5000, - "range_scan": false, - "scan_cost": "REPLACED", - "usable": false, - "cause": "cost" - } - ] - } - } - ], - "can_skip_filesort": false, - "full_join_cost": "REPLACED", - "risk_ratio": 10, - "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 197.826608, - "use_shortcut_cost": false - } -] +NULL # # Query 4: LEFT JOIN makes it impossible to put ORDER-BY-table first, # however the optimizer still puts it as sort_by_table. @@ -304,7 +197,8 @@ 1 PRIMARY t10 ref a a 5 test.t10.a 1 1 PRIMARY t1 ref a,b a 5 test.t10.a 100 Using where 1 PRIMARY t11 ref b b 5 test.t1.b 1 -1 PRIMARY t11 ref b b 5 test.t1.b 1 Using index; FirstMatch(t11) +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 +3 MATERIALIZED t11 index b b 5 NULL 150 Using index set optimizer_join_limit_pref_ratio=10; # t1 is first, key=col1 produces ordering, no filesort or temporary: explain @@ -331,54 +225,7 @@ set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; JS -[ - { - "limit_fraction": 0.001, - "test_if_skip_sort_order_early": - [ - { - "reconsidering_access_paths_for_index_ordering": - { - "clause": "ORDER BY", - "table": "t1", - "rows_estimation": 10000, - "filesort_cost": "REPLACED", - "read_cost": "REPLACED", - "filesort_type": "priority_queue with row lookup", - "fanout": 1, - "possible_keys": - [ - { - "index": "a", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "b", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "col1", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 10, - "range_scan": false, - "scan_cost": "REPLACED", - "chosen": true - } - ] - } - } - ], - "can_skip_filesort": true, - "full_join_cost": "REPLACED", - "risk_ratio": 10, - "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 0.535649162, - "use_shortcut_cost": true - } -] +NULL # # Query 6: same as Query 1 but let's limit the search depth # @@ -419,54 +266,7 @@ set @trace=(select trace from information_schema.optimizer_trace); select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; JS -[ - { - "limit_fraction": 0.001, - "test_if_skip_sort_order_early": - [ - { - "reconsidering_access_paths_for_index_ordering": - { - "clause": "ORDER BY", - "table": "t1", - "rows_estimation": 10000, - "filesort_cost": "REPLACED", - "read_cost": "REPLACED", - "filesort_type": "priority_queue with row lookup", - "fanout": 1, - "possible_keys": - [ - { - "index": "a", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "b", - "can_resolve_order": false, - "cause": "not usable index for the query" - }, - { - "index": "col1", - "can_resolve_order": true, - "direction": 1, - "rows_to_examine": 10, - "range_scan": false, - "scan_cost": "REPLACED", - "chosen": true - } - ] - } - } - ], - "can_skip_filesort": true, - "full_join_cost": "REPLACED", - "risk_ratio": 10, - "shortcut_join_cost": "REPLACED", - "shortcut_cost_with_risk": 0.495218616, - "use_shortcut_cost": true - } -] +NULL set optimizer_search_depth=@tmp_osd; set optimizer_trace=@tmp_os; # An extra testcase for MDEV-35164 (its main testcase is below). Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.order_by_limit_join/' ReplayTest: Loading context main.range_interrupted-13751 [ pass ] 41 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.range_notembedded [ fail ] Test ended at 2026-04-23 23:15:43 CURRENT_TEST: main.range_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_notembedded.result 2026-04-17 18:40:40.480801219 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_notembedded.reject 2026-04-23 23:15:43.227889473 +0300 @@ -19,18 +19,7 @@ select json_detailed(JSON_EXTRACT(trace, '$**.ranges')) from information_schema.optimizer_trace; json_detailed(JSON_EXTRACT(trace, '$**.ranges')) -[ - [ - "(1) <= (key1) <= (1)", - "(2) <= (key1) <= (2)", - "(3) <= (key1) <= (3)" - ], - [ - "(1) <= (key1) <= (1)", - "(2) <= (key1) <= (2)", - "(3) <= (key1) <= (3)" - ] -] +NULL set optimizer_trace=@tmp_21958; drop table t2; # @@ -68,20 +57,7 @@ # to keep the number of ranges at manageable level: select left(@json, 500); left(@json, 500) -[ - [ - { - "index": "key1", - "ranges": - [ - "(1,1,1) <= (kp1,kp2,kp3) <= (1,1,1)", - "(1,1,2) <= (kp1,kp2,kp3) <= (1,1,2)", - "(1,1,3) <= (kp1,kp2,kp3) <= (1,1,3)", - "(1,1,4) <= (kp1,kp2,kp3) <= (1,1,4)", - "(1,1,5) <= (kp1,kp2,kp3) <= (1,1,5)", - "(1,1,6) <= (kp1,kp2,kp3) <= (1,1,6)", - "(1,1,7) <= (kp1,kp2,kp3) <= (1,1,7)", - "(1,1,8) <= (kp +NULL ## Repeat the above with low max_weight: set @tmp9750_weight=@@optimizer_max_sel_arg_weight; set optimizer_max_sel_arg_weight=20; @@ -97,58 +73,11 @@ set @json= json_detailed(json_extract(@trace, '$**.range_scan_alternatives')); select left(@json, 500); left(@json, 500) -[ - [ - { - "index": "key1", - "ranges": - [ - "(1) <= (kp1) <= (1)", - "(2) <= (kp1) <= (2)", - "(3) <= (kp1) <= (3)", - "(4) <= (kp1) <= (4)", - "(5) <= (kp1) <= (5)", - "(6) <= (kp1) <= (6)", - "(7) <= (kp1) <= (7)", - "(8) <= (kp1) <= (8)", - "(9) <= (kp1) <= (9)", - "(10) <= (kp1) <= (10)" - ], - +NULL set @json= json_detailed(json_extract(@trace, '$**.setup_range_conditions')); select left(@json, 2500); left(@json, 2500) -[ - [ - { - "sel_arg_weight_heuristic": - { - "key1_field": "kp1", - "key2_field": "kp2", - "key1_weight": 10, - "key2_weight": 10 - } - }, - { - "sel_arg_weight_heuristic": - { - "key1_field": "kp1", - "key2_field": "kp3", - "key1_weight": 10, - "key2_weight": 10 - } - }, - { - "sel_arg_weight_heuristic": - { - "key1_field": "kp1", - "key2_field": "kp4", - "key1_weight": 10, - "key2_weight": 10 - } - } - ] -] +NULL ## Repeat the above with a bit higher max_weight: set optimizer_max_sel_arg_weight=120; explain select * from t1 where @@ -163,43 +92,7 @@ from information_schema.optimizer_trace); select left(@json, 1500); left(@json, 1500) -[ - [ - { - "index": "key1", - "ranges": - [ - "(1,1) <= (kp1,kp2) <= (1,1)", - "(1,2) <= (kp1,kp2) <= (1,2)", - "(1,3) <= (kp1,kp2) <= (1,3)", - "(1,4) <= (kp1,kp2) <= (1,4)", - "(1,5) <= (kp1,kp2) <= (1,5)", - "(1,6) <= (kp1,kp2) <= (1,6)", - "(1,7) <= (kp1,kp2) <= (1,7)", - "(1,8) <= (kp1,kp2) <= (1,8)", - "(1,9) <= (kp1,kp2) <= (1,9)", - "(1,10) <= (kp1,kp2) <= (1,10)", - "(2,1) <= (kp1,kp2) <= (2,1)", - "(2,2) <= (kp1,kp2) <= (2,2)", - "(2,3) <= (kp1,kp2) <= (2,3)", - "(2,4) <= (kp1,kp2) <= (2,4)", - "(2,5) <= (kp1,kp2) <= (2,5)", - "(2,6) <= (kp1,kp2) <= (2,6)", - "(2,7) <= (kp1,kp2) <= (2,7)", - "(2,8) <= (kp1,kp2) <= (2,8)", - "(2,9) <= (kp1,kp2) <= (2,9)", - "(2,10) <= (kp1,kp2) <= (2,10)", - "(3,1) <= (kp1,kp2) <= (3,1)", - "(3,2) <= (kp1,kp2) <= (3,2)", - "(3,3) <= (kp1,kp2) <= (3,3)", - "(3,4) <= (kp1,kp2) <= (3,4)", - "(3,5) <= (kp1,kp2) <= (3,5)", - "(3,6) <= (kp1,kp2) <= (3,6)", - "(3,7) <= (kp1,kp2) <= (3,7)", - "(3,8) <= (kp1,kp2) <= (3,8)", - "(3,9) <= (kp1,kp2) <= (3,9)", - "(3,10) <= (kp1,kp2) <= (3,10)", - +NULL set optimizer_max_sel_arg_weight= @tmp9750_weight; set optimizer_trace=@tmp_9750; drop table t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.range_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: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.range_vs_index_merge [ fail ] Test ended at 2026-04-23 23:15:47 CURRENT_TEST: main.range_vs_index_merge --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_vs_index_merge.result 2026-04-02 14:38:09.445657407 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/range_vs_index_merge.reject 2026-04-23 23:15:47.175833406 +0300 @@ -48,14 +48,18 @@ WHERE (Population >= 100000 OR Name LIKE 'P%') AND Country='CAN' OR (Population < 100000 OR Name Like 'T%') AND Country='ARG'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Country 3 NULL 104 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1854. EXPLAIN SELECT * FROM City WHERE Population < 200000 AND Name LIKE 'P%' AND (Population > 300000 OR Name LIKE 'T%') AND (Population < 100000 OR Name LIKE 'Pa%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Name 35 NULL 135 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Population > 100000 AND Name LIKE 'Aba%' OR @@ -63,7 +67,9 @@ Country <= 'ALB' AND Name LIKE 'L%' OR ID BETWEEN 3807 AND 3810; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,PRIMARY,Country 35,4,3 NULL 30 Using sort_union(Name,PRIMARY,Country); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1253. EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 115000); @@ -206,7 +212,7 @@ WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR (Name BETWEEN 'P' AND 'S' AND (Population > 103000 AND Population < 104000)); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Name,Population 35,4 NULL 50 Using sort_union(Name,Population); Using where +1 SIMPLE City index_merge Population,Country,Name Country,Population 3,4 NULL 141 Using sort_union(Country,Population); Using where EXPLAIN SELECT * FROM City WHERE (Name < 'Bb' AND (Country > 'A' AND Country < 'B')) OR @@ -342,32 +348,42 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'H%' OR Name LIKE 'P%' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 223 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 676. EXPLAIN SELECT * FROM City WHERE Name LIKE 'Ha%' OR Name LIKE 'Pa%' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 72 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 677. EXPLAIN SELECT * FROM City WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 110) AND (Name LIKE 'P%' OR (Population > 103000 AND Population < 104000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 20 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1257. EXPLAIN SELECT * FROM City WHERE ((ID < 800) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 900 AND 1500) AND (Name LIKE 'Pa%' OR (Population > 103000 AND Population < 105000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,Population 35,3,4 NULL 151 Using sort_union(Name,Country,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1260. EXPLAIN SELECT * FROM City WHERE ((ID < 200) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 200) AND (Name LIKE 'Pa%' OR (Population > 103200 AND Population < 104000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,Population 35,3,4 NULL 124 Using sort_union(Name,Country,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1233. SELECT * FROM City USE INDEX () WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 110) AND @@ -607,7 +623,9 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'P%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 135 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 676. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 102000) AND @@ -615,7 +633,9 @@ ((ID BETWEEN 3400 AND 3800) AND (Country < 'AGO' OR Name LIKE 'Pa%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name,Population 3,35,4 NULL 83 Using sort_union(Country,Name,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 3516. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) AND @@ -623,7 +643,9 @@ ((ID BETWEEN 3790 AND 3800) AND (Country < 'C' OR Name LIKE 'P%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name,PRIMARY 3,35,4 NULL 55 Using sort_union(Country,Name,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2390. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 AND Population < 102000) AND (Country < 'C' OR Name BETWEEN 'P' AND 'S')) OR @@ -678,11 +700,15 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'Pas%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 4 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 791. EXPLAIN SELECT * FROM City WHERE Name LIKE 'P%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 135 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 789. EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 103000); id select_type table type possible_keys key key_len ref rows Extra @@ -700,13 +726,17 @@ WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%') AND Country='USA'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name,CountryPopulation CountryPopulation,Name 7,35 NULL 14 Using sort_union(CountryPopulation,Name); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4282. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'P%') AND Country='EST'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 2 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 4268. SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%') AND Country='USA'; @@ -795,7 +825,9 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'Pa%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Name Name 35 NULL 41 Using index condition +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 897. set @tmp_range_vs_index_merge=@@optimizer_switch; set optimizer_switch='extended_keys=off'; EXPLAIN @@ -804,14 +836,18 @@ ID BETWEEN 3790 AND 3800) AND Country='USA' AND (Name LIKE 'Pa%' OR ID BETWEEN 4025 AND 4035); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryPopulation,PRIMARY 7,4 NULL 14 Using sort_union(CountryPopulation,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7846. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 103000) OR ID BETWEEN 3790 AND 3800) AND Country='USA' AND (Name LIKE 'Pa%' OR ID BETWEEN 4028 AND 4032); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName,PRIMARY 38,4 NULL 11 Using sort_union(CountryName,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7846. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) OR @@ -867,7 +903,9 @@ ID BETWEEN 3790 AND 3800) AND Country='USA' OR (Name LIKE 'Pa%' OR ID BETWEEN 250 AND 260) AND Country='BRA'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryPopulation,PRIMARY,CountryName 7,4,38 NULL 35 Using sort_union(CountryPopulation,PRIMARY,CountryName); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 7941. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 and Population < 102000) OR ID BETWEEN 3790 AND 3800) AND Country='USA' @@ -950,14 +988,18 @@ ID BETWEEN 3500 AND 3800) AND Country='USA' AND (Name LIKE 'P%' OR ID BETWEEN 4000 AND 4300); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName 38 NULL 23 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2041. EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 11000) OR ID BETWEEN 3500 AND 3800) AND Country='USA' AND (Name LIKE 'Pho%' OR ID BETWEEN 4000 AND 4300); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName Name 35 NULL 1 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2043. SELECT * FROM City USE INDEX () WHERE ((Population > 101000 AND Population < 11000) OR ID BETWEEN 3500 AND 3800) AND Country='USA' @@ -992,7 +1034,9 @@ WHERE Country='USA' AND Population BETWEEN 101000 AND 102000 OR Country='USA' AND Name LIKE 'Pa%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Country,CountryPopulation,CountryName CountryPopulation,CountryName 7,38 NULL 10 Using sort_union(CountryPopulation,CountryName); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 5372. SELECT * FROM City USE INDEX() WHERE Country='USA' AND Population BETWEEN 101000 AND 102000 OR Country='USA' AND Name LIKE 'Pa%'; @@ -1022,7 +1066,9 @@ WHERE Country='USA' AND (Population BETWEEN 101000 AND 102000 OR Name LIKE 'Pa%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Country,CountryPopulation,CountryName CountryPopulation,CountryName 7,38 NULL 10 Using sort_union(CountryPopulation,CountryName); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 5372. SELECT * FROM City WHERE Country='USA' AND (Population BETWEEN 101000 AND 102000 OR Name LIKE 'Pa%'); @@ -1381,7 +1427,7 @@ AND (Population >= 100000 AND Population < 120000) ORDER BY Population LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Country,Name,Population Population 4 NULL # Using index condition; Using where +1 SIMPLE City range Country,Name,Population Population 4 NULL # Using where FLUSH STATUS; SELECT * FROM City WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H')) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.range_vs_index_merge/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_myisam [ fail ] Test ended at 2026-04-23 23:15:49 CURRENT_TEST: main.rowid_filter_myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_myisam.result 2026-04-02 14:38:09.449657396 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_myisam.reject 2026-04-23 23:15:48.876809566 +0300 @@ -129,47 +129,19 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 eq_ref PRIMARY,b1 PRIMARY 4 test.t2.a2 1 87.00 Using where +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`pk1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t2`.`a2` <> `test`.`t2`.`pk2` +Note 1003 /* select#1 */ select 0 AS `pk1`,NULL AS `a1`,NULL AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where 0 EXPLAIN FORMAT=JSON SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); EXPLAIN { "query_block": { "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 101, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.a2 <> t2.pk2 and t2.a2 is not null" - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "b1"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["pk1"], - "ref": ["test.t2.a2"], - "loops": 101, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 87, - "attached_condition": "t1.b1 <= (subquery#2)" - } - } - ], + "table": { + "message": "Impossible WHERE noticed after reading const tables" + }, "subqueries": [ { "query_block": { @@ -233,7 +205,10 @@ select * from t1 where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 645 Using where +1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 1 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(10) <= (el_index) <= (10\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF), ] doesn't exist in the list of ranges for table_name test.t1 and index_name el_index +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(10) <= (el_index_60) <= (10\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF), (20) <= (el_index_60) <= (20\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\ drop table t10, t11, t1; # # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT @@ -333,7 +308,9 @@ explain select * from t1 where nm like '500%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 569. analyze format=json select * from t1 where nm like '500%' AND fl2 = 0; ANALYZE @@ -393,7 +370,9 @@ explain select * from t1 where nm like '500%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 569. analyze format=json select * from t1 where nm like '500%' AND fl2 = 0; ANALYZE @@ -456,7 +435,9 @@ explain select * from t1 where nm like '607%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 569. select * from t1 where nm like '607%' AND fl2 = 0; pk nm fl1 fl2 721 607 0 0 @@ -478,7 +459,9 @@ explain select * from t1 where nm like '75%' AND fl2 = 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 2|35 const 55 (1%) Using where; Using rowid filter +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 572. analyze format=json select * from t1 where nm like '75%' AND fl2 = 0; ANALYZE Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_myisam/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.rownum [ fail ] Test ended at 2026-04-23 23:15:52 CURRENT_TEST: main.rownum --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rownum.result 2026-04-02 14:38:09.450657394 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rownum.reject 2026-04-23 23:15:52.723756347 +0300 @@ -963,7 +963,7 @@ 3 SUBQUERY t1 ALL NULL NULL NULL NULL 5 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `tt`.`a` AS `a` from (/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1000 limit 5) `tt` where (/* select#3 */ select max(`test`.`t1`.`a`) from `test`.`t1`) >= rownum() limit 5 +Note 1003 /* select#1 */ select `tt`.`a` AS `a` from (/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1000) `tt` where (/* select#3 */ select max(`test`.`t1`.`a`) from `test`.`t1`) >= rownum() prepare stmt from "select * from (select a from t1 where a < 1000) as tt where (select max(a) from t1) >= rownum()"; execute stmt; a Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rownum/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.sargable_casefold [ pass ] 363 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sargable_casefold_notembedded [ fail ] Test ended at 2026-04-23 23:15:53 CURRENT_TEST: main.sargable_casefold_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sargable_casefold_notembedded.result 2026-04-02 14:38:09.450657394 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/sargable_casefold_notembedded.reject 2026-04-23 23:15:53.734742518 +0300 @@ -21,12 +21,7 @@ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS from information_schema.optimizer_trace; JS -[ - { - "before": "'abc' = ucase(t1.col1)", - "after": "'abc' = t1.col1" - } -] +NULL explain select * from t1 where ucase(col2)=upper(col1); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where @@ -34,12 +29,7 @@ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS from information_schema.optimizer_trace; JS -[ - { - "before": "ucase(t1.col2) = ucase(t1.col1)", - "after": "t1.col2 = t1.col1" - } -] +NULL explain select * from t1 where upper(col1) IN ('A-3','A-4','a-5'); id select_type table type possible_keys key key_len ref rows Extra @@ -49,12 +39,7 @@ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS from information_schema.optimizer_trace; JS -[ - { - "before": "ucase(t1.col1) in ('A-3','A-4','a-5')", - "after": "t1.col1 in ('A-3','A-4','a-5')" - } -] +NULL set optimizer_trace=@tmp_ot, optimizer_switch=@tmp_os; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.sargable_casefold_notembedded/' main.slowlog_enospace-10508 [ pass ] 93 main.sp-big [ pass ] 1467 main.sp-row [ pass ] 310 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_flush [ pass ] 54 main.statistics_upgrade [ pass ] 738 main.status_debug [ pass ] 24 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test" ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect [ fail ] Test ended at 2026-04-23 23:16:08 CURRENT_TEST: main.subselect --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.result 2026-04-17 18:40:40.507802888 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.reject 2026-04-23 23:16:07.886555698 +0300 @@ -401,7 +401,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -584,7 +584,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1459,11 +1459,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1524,32 +1520,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1562,44 +1542,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1662,10 +1621,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1698,29 +1653,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1731,81 +1666,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1850,13 +1740,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1971,18 +1854,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2003,19 +1875,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2516,13 +2379,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00 -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where 1 drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2692,16 +2548,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3065,24 +2915,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3206,10 +3040,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3218,10 +3048,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3270,9 +3096,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3305,9 +3128,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3670,10 +3490,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3682,10 +3498,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL a NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3805,10 +3617,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3830,18 +3638,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4304,9 +4102,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4342,11 +4137,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4481,9 +4271,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4491,16 +4278,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4520,9 +4301,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4543,24 +4321,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4636,19 +4399,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4669,8 +4420,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4691,9 +4440,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4713,10 +4459,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4735,11 +4477,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5083,10 +4820,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5781,12 +5514,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ALL NULL NULL NULL NULL 4 -2 MATERIALIZED it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5803,10 +5530,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502 SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5814,9 +5537,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1) DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5832,10 +5552,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1 -1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5855,9 +5571,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6098,12 +5811,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6118,10 +5826,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6174,9 +5878,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6186,9 +5887,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6232,8 +5930,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6246,9 +5942,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6269,9 +5962,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6291,9 +5981,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6342,10 +6029,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6364,15 +6047,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6501,10 +6178,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6756,18 +6429,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6820,33 +6487,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6860,12 +6515,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6877,20 +6526,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6949,9 +6588,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6961,11 +6597,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6983,12 +6614,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7009,13 +6634,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7052,13 +6670,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7099,10 +6710,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7121,11 +6728,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7154,10 +6756,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7171,11 +6769,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY ALL distinct_key NULL NULL NULL 1 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7188,10 +6781,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7397,13 +6986,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7415,9 +6998,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect4' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200603 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: 19071 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 mysql-test-run: replay server restarted (pid 200603) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'f2' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 852 ReplayTest: Loading context ReplayTest: Query error: Field 'f2' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 863 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 1937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: explain SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1) ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: EXPLAIN EXTENDED SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1) ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2083 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2135 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2139 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2143 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2174 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2203 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2213 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2260 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2289 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2300 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2396 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2441 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2453 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2459 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2484 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2498 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2507 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2515 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2524 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2533 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2553 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2558 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2564 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2569 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2574 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2641 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.test" ReplayTest: At line 2660 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect4 [ fail ] Test ended at 2026-04-23 23:16:19 CURRENT_TEST: main.subselect4 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.result 2026-04-17 18:40:40.509803011 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect4.reject 2026-04-23 23:16:18.857550258 +0300 @@ -1142,10 +1142,6 @@ SELECT t1.f3, MAX(t1.f2) FROM t1, t2 WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system PRIMARY NULL NULL NULL 1 -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 -2 DEPENDENT SUBQUERY t1 index_subquery f2 f2 4 func 1 Using index SELECT t1.f3, MAX(t1.f2) FROM t1, t2 WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1); @@ -1156,10 +1152,6 @@ SELECT t1.f3, MAX(t1.f2) FROM t1, t2 WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system PRIMARY NULL NULL NULL 1 -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 -2 MATERIALIZED t1 index NULL f2 4 NULL 2 Using index SELECT t1.f3, MAX(t1.f2) FROM t1, t2 WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1); @@ -1260,10 +1252,9 @@ EXPLAIN SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; Start temporary; End temporary +1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index; Using join buffer (flat, BNL join) 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2); c1 c1 SET optimizer_switch=@save_optimizer_switch; @@ -1383,7 +1374,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 0 SELECT COUNT(t2.f3), (SELECT COUNT(f3) FROM t1 WHERE t2.f1) AS f9 FROM t2 JOIN t1 ON t1.f3 @@ -1399,7 +1390,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 0 SELECT COUNT(t2.f3), (SELECT COUNT(f3) FROM t1 WHERE t2.f1) AS f9 FROM t2 JOIN t1 ON t1.f3 @@ -1416,7 +1407,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 0 SELECT COUNT(t2.f3), (SELECT t2.f1 FROM t1 limit 1) AS f9 FROM t2 JOIN t1 @@ -1432,7 +1423,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 0 SELECT COUNT(t2.f3), (SELECT t2.f1 FROM t1 limit 1) AS f9 FROM t2 JOIN t1 @@ -1756,7 +1747,7 @@ EXPLAIN SELECT * FROM t1 WHERE ( 6 ) NOT IN ( SELECT t2.f3 FROM t2 JOIN t3 ON t3.f10 = t2.f10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found 2 SUBQUERY t3 system NULL NULL NULL NULL 1 2 SUBQUERY t2 ref_or_null f10 f10 10 const,const 2 Using where; Using index SELECT * FROM t1 WHERE ( 6 ) NOT IN ( SELECT t2.f3 FROM t2 JOIN t3 ON t3.f10 = t2.f10); @@ -1778,8 +1769,8 @@ SELECT DISTINCT f11 FROM t1)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 drop table t1, t2, t3; # @@ -1800,9 +1791,8 @@ WHERE EXISTS (SELECT DISTINCT f1 FROM t4)) AND t2.f2 = t1.f1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref f1 f1 5 const 0 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t4 index NULL f1 5 NULL 2 Using index SELECT * FROM t1, t2 @@ -1817,9 +1807,8 @@ WHERE EXISTS (SELECT DISTINCT f1 FROM t4) LIMIT 1) AND t2.f2 = t1.f1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref f1 f1 5 const 0 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t4 index NULL f1 5 NULL 2 Using index SELECT * FROM t1, t2 @@ -2370,9 +2359,7 @@ INSERT INTO t1 (x) VALUES (0),(0),(0); EXPLAIN SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +ReplayTest: Query error: Lost connection to server during query SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; x 0 @@ -2470,9 +2457,7 @@ # explain SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +ReplayTest: Direct EXPLAIN failed on replay server: 2006 Server has gone away SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1); 2 IN (SELECT 2 from DUAL WHERE 1 != 1) 0 @@ -2520,24 +2505,11 @@ INSERT INTO t1 VALUES (1,1),(2,2),(3,3); INSERT INTO t2 VALUES (1,1),(2,2),(3,3); EXPLAIN EXTENDED SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Zero limit -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1276 Field or reference 'test.t2.b' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t2.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select sum(`test`.`t2`.`a`) AS `sum(a)`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` having (`test`.`t2`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t1` where (`test`.`t2`.`a`) = `test`.`t2`.`b`)) +ReplayTest: Direct EXPLAIN failed on replay server: 2006 Server has gone away SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1); sum(a) a b SET @@sql_select_limit= @save_sql_select_limit; EXPLAIN EXTENDED SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1); -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 -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1276 Field or reference 'test.t2.b' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t2.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select sum(`test`.`t2`.`a`) AS `sum(a)`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` having <`test`.`t2`.`a`,`test`.`t2`.`b`>((`test`.`t2`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t1` where (`test`.`t2`.`a`) = `test`.`t2`.`b`))) SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1); sum(a) a b 6 1 1 @@ -2550,11 +2522,6 @@ CREATE TABLE t2 (v1 varchar(10) CHARACTER SET utf8, KEY v1 (v1(3))); INSERT INTO t2 VALUES ('k'),('rid'),('f'),('x'); EXPLAIN EXTENDED SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); -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 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`l1` AS `l1`,`test`.`t1`.`i2` AS `i2` from `test`.`t1` where ((`test`.`t1`.`l1`,(/* select#2 */ select max(`test`.`t2`.`v1`) from `test`.`t2`) > convert((`test`.`t1`.`l1`) using utf8mb3))) SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); l1 i2 e 2 @@ -2593,32 +2560,18 @@ INSERT INTO t2 VALUES (2),(3); EXPLAIN SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1); a 1 2 EXPLAIN SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY A ALL NULL NULL NULL NULL 2 -3 UNION B ALL NULL NULL NULL NULL 2 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1); a 1 2 EXPLAIN SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1); a 1 @@ -2647,9 +2600,6 @@ INSERT INTO t2 VALUES ('1'),('bar'); EXPLAIN SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP); -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 t1 ALL NULL NULL NULL NULL 6000 Using filesort SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP); f 1 @@ -2678,10 +2628,6 @@ CREATE TABLE t2 (b VARBINARY(8)); EXPLAIN SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2); a DROP TABLE t1,t2; @@ -2690,10 +2636,6 @@ CREATE TABLE t2 (b VARBINARY(8)); EXPLAIN SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2); a DROP TABLE t1,t2; @@ -2732,12 +2674,6 @@ explain select 1 from t2 join t1 on ('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 index NULL v1 9 NULL 5 Using index -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 Using where -2 MATERIALIZED t1 ref v1 v1 4 test.t3.v2 1 Using index -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 50 select 1 from t2 join t1 on ('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10; @@ -2762,8 +2698,6 @@ # EXPLAIN SELECT * FROM t1 WHERE (t1.a,t1.b) IN (('abx',1),('def',2), ('abc', 3)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where set names utf8 collate utf8_general_ci; # # IN predicate to IN subquery is performed as materialization is allowed @@ -2772,10 +2706,6 @@ # this test in 10.5 has only 2 rows in the IN predicate EXPLAIN SELECT * FROM t2 WHERE (t2.a,t2.b) IN (('abc',1), ('def', 2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where -1 PRIMARY ref key1,distinct_key key1 4 test.t2.b 1 Using where; FirstMatch(t2) -3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used set names default; set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold; DROP TABLE t1,t2; @@ -2864,10 +2794,6 @@ FROM t10 tn JOIN t11 tms ON tms.key1 = tn.key1 WHERE tn.key1 IN ('1','2','3','4','5','6','7','8','9','10') ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY hist ALL NULL NULL NULL NULL 100 Using where -2 DEPENDENT SUBQUERY tn range PRIMARY PRIMARY 32 NULL 10 Using index condition; Using where -2 DEPENDENT SUBQUERY tms eq_ref PRIMARY PRIMARY 32 test.tn.key1 1 Using index set optimizer_switch=@tmp_os; drop table t1, t10, t11; # @@ -2990,12 +2916,6 @@ insert into t3 values (7), (1); explain extended select a from t1 where a >= any (select b from t2 group by (select c from t3 where c = 1)); -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 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` group by (/* select#3 */ select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` = 1)) <= (`test`.`t1`.`a`))) select a from t1 where a >= any (select b from t2 group by (select c from t3 where c = 1)); a @@ -3008,12 +2928,6 @@ deallocate prepare stmt; explain extended select a from t1 where a <= all (select b from t2 group by (select c from t3 where c = 1)); -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 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` group by (/* select#3 */ select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` = 1)) < (`test`.`t1`.`a`))) select a from t1 where a <= all (select b from t2 group by (select c from t3 where c = 1)); a @@ -3022,12 +2936,6 @@ 2 explain extended select a from t1 where a >= any (select b from t2 group by 1 + (select c from t3 where c = 1)); -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 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` group by 1 + (/* select#3 */ select `test`.`t3`.`c` from `test`.`t3` where `test`.`t3`.`c` = 1)) <= (`test`.`t1`.`a`))) select a from t1 where a >= any (select b from t2 group by 1 + (select c from t3 where c = 1)); a @@ -3047,13 +2955,6 @@ explain extended select b from t2 where exists (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where (1,exists(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by ((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) = `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null))) limit 1)) select b from t2 where exists (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); @@ -3076,13 +2977,6 @@ where exists (select c from t3 group by (select a from t1 where a = 1) >= any (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where (1,exists(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by (<(/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)>(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) >= `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null))))) limit 1)) select b from t2 where exists (select c from t3 group by (select a from t1 where a = 1) >= @@ -3094,13 +2988,6 @@ where exists (select c from t3 group by (select a from t1 where a = 1) < all (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where (1,exists(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by (<(/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)>(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) >= `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null))))) limit 1)) select b from t2 where exists (select c from t3 group by (select a from t1 where a = 1) < @@ -3111,14 +2998,6 @@ explain extended select b from t2 where b in (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t2.b 1 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from (/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by ((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) = `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null)))) join `test`.`t2` where ``.`c` = `test`.`t2`.`b` select b from t2 where b in (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); @@ -3127,13 +3006,6 @@ where b >= any (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b`,(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by ((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) = `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null)))) <= (`test`.`t2`.`b`))) select b from t2 where b >= any (select c from t3 group by (select a from t1 where a = 1) in @@ -3143,13 +3015,6 @@ where b <= all (select c from t3 group by (select a from t1 where a = 1) in (select d from t4)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where -2 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 -4 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` where ((`test`.`t2`.`b`,(/* select#2 */ select `test`.`t3`.`c` from `test`.`t3` group by ((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1),(/* select#4 */ select `test`.`t4`.`d` from `test`.`t4` where trigcond(((/* select#3 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`a` = 1)) = `test`.`t4`.`d` or `test`.`t4`.`d` is null) having trigcond(`test`.`t4`.`d` is null)))) < (`test`.`t2`.`b`))) select b from t2 where b <= all (select c from t3 group by (select a from t1 where a = 1) in @@ -3172,40 +3037,22 @@ explain select * from t1 where exists (select * from t2 where t2.a=t1.a order by t2.b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 100 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 100 # query with a non-zero constant LIMIT is converted to semi-join, too: explain select * from t1 where exists (select * from t2 where t2.a=t1.a order by t2.b limit 2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 100 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 100 # Zero LIMIT should prevent the conversion (but it is not visible atm # due to MDEV-19429) explain select * from t1 where exists (select * from t2 where t2.a=t1.a order by t2.b limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit # LIMIT+OFFSET prevents the conversion: explain select * from t1 where exists (select * from t2 where t2.a=t1.a order by t2.b limit 2,3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 100 Using where; Using filesort # This will be merged and converted into a semi-join: explain select * from t1 where t1.a in (select t2.a from t2 order by t2.b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 100 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 100 drop table t0, t1, t2; # # MDEV-32320: Server crashes at TABLE::add_tmp_key @@ -3266,67 +3113,6 @@ 1 EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 0.012403489, - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": 0.010504815, - "filtered": 100, - "attached_condition": "t1.a = ((((subquery#2),(subquery#3))) + 1)" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 3, - "cost": 0.01034841, - "having_condition": "trigcond(t3.c is null)", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": 0.01034841, - "filtered": 100, - "attached_condition": "trigcond(1 = t3.c or t3.c is null)" - } - } - ] - } - }, - { - "query_block": { - "select_id": 2, - "cost": 0.01034841, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": 0.01034841, - "filtered": 100, - "attached_condition": "t2.b = 1" - } - } - ] - } - } - ] - } -} PREPARE stmt FROM "SELECT a FROM t1 GROUP BY a HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1"; EXECUTE stmt; @@ -3357,14 +3143,10 @@ 1 flush status; explain select * from t1 where a<3 or (select max(a) from t2) in (select b from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 200 Using where -3 SUBQUERY t3 ALL NULL NULL NULL NULL 200 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 200 # Must show 0. If this shows 200, this means subquery was executed and you have a bug: show status like 'Handler_read_rnd_next%'; Variable_name Value -Handler_read_rnd_next 0 +Handler_read_rnd_next 2 drop table t1,t2,t3; # End of 10.4 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect4/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_exists2in' mysql-test-run: restarting replay server... Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200649 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: 19071 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 mysql-test-run: replay server restarted (pid 200649) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_exists2in [ pass ] 424 ReplayTest: Loading context main.subselect_firstmatch [ pass ] 8 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.test at line 8: ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_exists_to_in [ fail ] Test ended at 2026-04-23 23:16:33 CURRENT_TEST: main.subselect_no_exists_to_in --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.result 2026-04-17 18:40:40.511803135 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_exists_to_in.reject 2026-04-23 23:16:33.516247794 +0300 @@ -405,7 +405,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -588,7 +588,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1463,11 +1463,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1528,32 +1524,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1566,44 +1546,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1666,10 +1625,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1702,29 +1657,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1735,81 +1670,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1854,13 +1744,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1975,18 +1858,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !<`test`.`tt`.`id`>(exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2007,19 +1879,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2520,12 +2383,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 25 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where <`test`.`up`.`a`>(exists(/* select#2 */ select 1 from `test`.`t1` where `test`.`t1`.`a` = `test`.`up`.`a` limit 1)) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2695,16 +2552,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3068,24 +2919,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3209,10 +3044,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3221,10 +3052,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3273,9 +3100,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3308,9 +3132,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3673,10 +3494,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3685,10 +3502,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL a NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3808,10 +3621,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3833,18 +3642,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4307,9 +4106,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4345,11 +4141,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4484,9 +4275,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4494,16 +4282,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4523,9 +4305,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4546,24 +4325,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists(/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` limit 1)) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4639,19 +4403,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4672,8 +4424,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4694,9 +4444,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4716,10 +4463,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4738,11 +4481,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5086,10 +4824,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5784,12 +5518,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ALL NULL NULL NULL NULL 4 -2 MATERIALIZED it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5806,9 +5534,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 502 Using where SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5816,9 +5541,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t2 ref idx idx 5 test.t1.a 58 Using index DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5834,10 +5556,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1 -1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5857,9 +5575,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6100,12 +5815,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6120,10 +5830,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6176,9 +5882,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6188,9 +5891,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6234,8 +5934,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6248,9 +5946,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6271,9 +5966,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6293,9 +5985,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6344,10 +6033,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6366,15 +6051,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6503,10 +6182,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6758,18 +6433,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6822,33 +6491,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6862,12 +6519,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6879,20 +6530,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6951,9 +6592,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6963,11 +6601,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6985,12 +6618,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7011,13 +6638,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7054,13 +6674,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7101,10 +6714,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7123,11 +6732,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7156,10 +6760,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7173,11 +6773,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY ALL distinct_key NULL NULL NULL 1 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7190,10 +6785,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7399,13 +6990,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7417,9 +7002,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_mat' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_exists_to_in/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200742 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: 19071 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 mysql-test-run: replay server restarted (pid 200742) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.test at line 12: ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_mat [ fail ] Test ended at 2026-04-23 23:16:45 CURRENT_TEST: main.subselect_no_mat --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.result 2026-04-17 18:40:40.511803135 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_mat.reject 2026-04-23 23:16:45.663114657 +0300 @@ -408,7 +408,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -591,7 +591,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1466,11 +1466,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1531,32 +1527,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1569,44 +1549,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1669,10 +1628,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1705,29 +1660,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1738,81 +1673,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1857,13 +1747,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1978,18 +1861,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2010,19 +1882,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2523,12 +2386,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 25 4.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`up`.`a` drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2698,16 +2555,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3071,23 +2922,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 11.11 Using where; Start temporary; End temporary -Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' and `test`.`t2`.`one` = `test`.`t1`.`one` and `test`.`t2`.`two` = `test`.`t1`.`two` explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3211,10 +3047,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3223,10 +3055,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3275,9 +3103,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3310,9 +3135,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3675,9 +3497,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3686,9 +3505,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 1 DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3808,10 +3624,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3833,18 +3645,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4307,9 +4109,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4345,11 +4144,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4484,9 +4278,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4494,16 +4285,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4523,9 +4308,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4546,24 +4328,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4639,17 +4406,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -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 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 0 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4670,8 +4427,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4692,9 +4447,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4714,10 +4466,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4736,11 +4484,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5084,10 +4827,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5782,11 +5521,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY it2 ALL NULL NULL NULL NULL 4 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5803,9 +5537,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -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 502 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5813,9 +5544,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1) DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5831,10 +5559,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1 -1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5854,9 +5578,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6097,12 +5818,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6117,10 +5833,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6173,9 +5885,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6185,9 +5894,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6231,8 +5937,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6245,9 +5949,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6268,9 +5969,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6290,9 +5988,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6341,10 +6036,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6363,15 +6054,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6500,10 +6185,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6755,18 +6436,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6819,33 +6494,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6859,12 +6522,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6876,20 +6533,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6948,9 +6595,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6960,11 +6604,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6982,11 +6621,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; Start temporary; Using join buffer (flat, BNL join) -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 End temporary; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7007,13 +6641,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7050,13 +6677,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7097,10 +6717,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7119,11 +6735,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7152,10 +6763,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7169,10 +6776,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7185,10 +6788,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7394,13 +6993,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7412,9 +7005,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_opts' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_mat/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200790 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: 19071 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 mysql-test-run: replay server restarted (pid 200790) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.test at line 12: ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_opts [ fail ] Test ended at 2026-04-23 23:16:57 CURRENT_TEST: main.subselect_no_opts --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.result 2026-04-17 18:40:40.511803135 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_opts.reject 2026-04-23 23:16:56.820999162 +0300 @@ -404,7 +404,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -587,7 +587,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1462,11 +1462,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1527,32 +1523,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where -2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and (`test`.`t2`.`a`) = `test`.`t1`.`a`)) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1565,44 +1545,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a))) select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using index -2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 33.33 Using where; Using index; Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and (`test`.`t2`.`a`) = `test`.`t1`.`a`)) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1665,10 +1624,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1701,29 +1656,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1734,81 +1669,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1853,13 +1743,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1974,18 +1857,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2006,19 +1878,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2519,12 +2382,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 25 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where (`test`.`up`.`a`,(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where (`test`.`up`.`a`) = `test`.`t1`.`a`)) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2694,16 +2551,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3067,23 +2918,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where ((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = 'N' and (`test`.`t1`.`one`) = `test`.`t2`.`one` and (`test`.`t1`.`two`) = `test`.`t2`.`two`)) explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3207,10 +3043,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3219,10 +3051,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3271,9 +3099,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3306,9 +3131,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3671,9 +3493,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3682,9 +3501,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 1 DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3804,10 +3620,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3829,18 +3641,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4303,9 +4105,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4341,11 +4140,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4480,9 +4274,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4490,16 +4281,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -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 t2 index_subquery I1 I1 4 func 1 Using index; Using where SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4519,9 +4304,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4542,24 +4324,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where (`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t1`.`a`) = `test`.`t2`.`a`)) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4635,17 +4402,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -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 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 0 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4666,8 +4423,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4688,9 +4443,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4710,10 +4462,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4732,11 +4480,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5080,10 +4823,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5778,11 +5517,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY it2 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY it3 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5799,9 +5533,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 502 Using where SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5809,9 +5540,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t2 index_subquery idx idx 5 func 58 Using index DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5827,10 +5555,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5850,9 +5574,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6093,12 +5814,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6113,10 +5829,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6169,9 +5881,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 1 Using index; Using where SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6181,9 +5890,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY it2 index_subquery idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 func,const 1 Using index; Using where SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6227,8 +5933,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6241,9 +5945,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6264,9 +5965,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6286,9 +5984,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6337,10 +6032,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6359,15 +6050,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6496,10 +6181,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6751,18 +6432,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6815,33 +6490,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6855,12 +6518,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6872,20 +6529,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6944,9 +6591,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6956,11 +6600,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6978,12 +6617,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7004,13 +6637,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7047,13 +6673,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7094,10 +6713,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7116,11 +6731,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7149,10 +6759,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7166,11 +6772,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY ALL distinct_key NULL NULL NULL 1 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7183,10 +6784,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7392,13 +6989,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7410,9 +7001,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_scache' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_opts/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200842 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: 19071 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 mysql-test-run: replay server restarted (pid 200842) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.test at line 11: ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_scache [ fail ] Test ended at 2026-04-23 23:17:08 CURRENT_TEST: main.subselect_no_scache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.result 2026-04-17 18:40:40.511803135 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_scache.reject 2026-04-23 23:17:08.127137916 +0300 @@ -407,7 +407,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -590,7 +590,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1465,11 +1465,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1530,32 +1526,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1568,44 +1548,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1668,10 +1627,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1704,29 +1659,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,(`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1737,81 +1672,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1856,13 +1746,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1977,18 +1860,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2009,19 +1881,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2522,13 +2385,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00 -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where 1 drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2698,16 +2554,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3071,24 +2921,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,((`test`.`t1`.`one`,`test`.`t1`.`two`),(/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' and trigcond(trigcond((`test`.`t1`.`one`) = `test`.`t2`.`one` or `test`.`t2`.`one` is null)) and trigcond(trigcond((`test`.`t1`.`two`) = `test`.`t2`.`two` or `test`.`t2`.`two` is null)) having trigcond(`test`.`t2`.`one` is null) and trigcond(`test`.`t2`.`two` is null))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3212,10 +3046,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3224,10 +3054,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3276,9 +3102,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3311,9 +3134,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3676,10 +3496,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3688,10 +3504,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL a NULL NULL NULL 9 Using where -1 PRIMARY eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3811,10 +3623,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3836,18 +3644,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4310,9 +4108,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4348,11 +4143,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4487,9 +4277,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4497,16 +4284,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan -1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4526,9 +4307,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4549,24 +4327,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4642,19 +4405,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where ``.`min(a)` = 1 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4675,8 +4426,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4697,9 +4446,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4719,10 +4465,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4741,11 +4483,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5089,10 +4826,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5787,12 +5520,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ALL NULL NULL NULL NULL 4 -2 MATERIALIZED it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5809,10 +5536,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502 SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5820,9 +5543,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1) DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5838,10 +5558,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1 -1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5861,9 +5577,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6104,12 +5817,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6124,10 +5832,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6180,9 +5884,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6192,9 +5893,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6238,8 +5936,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6252,9 +5948,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6275,9 +5968,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6297,9 +5987,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6348,10 +6035,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6370,15 +6053,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6507,10 +6184,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6762,18 +6435,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6826,33 +6493,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6866,12 +6521,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6883,20 +6532,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6955,9 +6594,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6967,11 +6603,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6989,12 +6620,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7015,13 +6640,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7058,13 +6676,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7105,10 +6716,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7127,11 +6734,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7160,10 +6762,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7177,11 +6775,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY ALL distinct_key NULL NULL NULL 1 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7194,10 +6787,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7403,13 +6992,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7421,9 +7004,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_semijoin' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_scache/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200896 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: 19071 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 mysql-test-run: replay server restarted (pid 200896) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 904 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 963 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 965 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 967 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 981 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 983 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 985 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 988 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1057 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1073 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1074 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1075 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1076 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1086 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1088 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1090 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1092 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1094 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1096 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1098 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1100 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1106 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1154 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1282 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1283 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1288 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1297 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1504 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1649 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1653 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1656 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 1999 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2000 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2001 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2117 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2124 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2184 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2216 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2527 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2670 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2698 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 2701 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3119 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3158 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3359 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3366 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3368 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3394 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3417 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3421 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3525 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3526 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3545 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3571 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3596 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3621 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 3980 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 4870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 4888 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 4894 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 4915 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 4930 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5101 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5102 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5118 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5156 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5164 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5219 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5224 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5242 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5245 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5293 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5317 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5320 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5424 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5665 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5668 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5725 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5729 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5733 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5737 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5752 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5767 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5771 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5826 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5837 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5858 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5883 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5937 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5960 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 5993 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 6010 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 6029 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 6256 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 6257 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test at line 10: ReplayTest: At line 6270 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.test" ReplayTest: At line 28 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_semijoin [ fail ] Test ended at 2026-04-23 23:17:20 CURRENT_TEST: main.subselect_no_semijoin --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.result 2026-04-17 18:40:40.512803197 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_no_semijoin.reject 2026-04-23 23:17:20.453025064 +0300 @@ -404,7 +404,7 @@ 2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index Warnings: -Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +Note 1003 /* select#1 */ select 'joce' AS `pseudo`,(/* select#2 */ select '' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); ERROR HY000: Illegal parameter data types varchar and row for operation '=' @@ -587,7 +587,7 @@ ERROR 21000: Subquery returns more than 1 row EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where `test`.`t1`.`numeropost` = '1' EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -1462,11 +1462,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(salary)); insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where `test`.`t1`.`salary` = (/* select#2 */ select max(`test`.`t1`.`salary`) from `test`.`t1`) +ReplayTest: Query error: Lost connection to server during query drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1527,32 +1523,16 @@ 3 4 explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY)))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on PRIMARY where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`)))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where -2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1565,44 +1545,23 @@ insert into t2 values (2), (3), (4), (5); insert into t3 values (10,3), (20,4), (30,5); explain extended select * from t2 where t2.a in (select a from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a)))) select * from t2 where t2.a in (select a from t1); a 2 3 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`)))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 4 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using index -2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 33.33 Using where; Using index; Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and (`test`.`t2`.`a`) = `test`.`t1`.`a`))) select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 insert into t1 values (3,31); explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <`test`.`t2`.`a`>((`test`.`t2`.`a`,(((`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and (`test`.`t2`.`a`) = `test`.`t1`.`a`)))) select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1665,10 +1624,6 @@ s1 tttt explain extended (select * from t1); -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 -Warnings: -Note 1003 (select 'tttt' AS `s1` from dual) (select * from t1); s1 tttt @@ -1701,29 +1656,9 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<`test`.`t1`.`s1`>((`test`.`t1`.`s1`,(((`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int not null); create table t3 (a int); @@ -1734,81 +1669,36 @@ 7 3 explain extended select * from t3 where a >= all (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); a explain extended select * from t3 where a >= some (select b from t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); a 6 7 3 explain extended select * from t3 where a >= all (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > (`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); a explain extended select * from t3 where a >= some (select b from t2 group by 1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= (`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); a explain extended select * from t3 where NULL >= any (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= any (select b from t2 group by 1); a explain extended select * from t3 where NULL >= any (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2); a explain extended select * from t3 where NULL >= some (select b from t2); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 select * from t3 where NULL >= some (select b from t2 group by 1); a explain extended select * from t3 where NULL >= some (select b from t2 group by 1); -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 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a 6 7 explain extended select * from t3 where a > all (select max(b) from t2 group by a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where ((`test`.`t3`.`a`,(/* select#2 */ select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= (`test`.`t3`.`a`))) drop table t2, t3; CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); @@ -1853,13 +1743,6 @@ s1 e explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 -2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -3 UNION t1 system NULL NULL NULL NULL 1 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 'e' AS `s1` from dual where 1 drop table t1; CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); @@ -1974,18 +1857,7 @@ 11 text11 12 text12 explain extended select * from t1 where id not in (select id from t1 where id < 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<`test`.`t1`.`id`>((`test`.`t1`.`id`,(((`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and (`test`.`t1`.`id`) = `test`.`t1`.`id`)))) explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where -2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index -Warnings: -Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !(1,<`test`.`tt`.`id`>(exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1))) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -2006,19 +1878,10 @@ 1000 text1000 NULL NULL 1000 text1000 1001 text1001 NULL NULL 1000 text1000 explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 -1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition -Warnings: -Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(`test`.`b`.`id` = `test`.`a`.`id` or `test`.`b`.`id` is null) join `test`.`t1` `c` where if(`test`.`b`.`id` is null,1000,`test`.`b`.`id`) = `test`.`c`.`id` drop table t1,t2; create table t1 (a int); insert into t1 values (1); explain select benchmark(1000, (select a from t1 where a=sha(rand()))); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 drop table t1; create table t1(id int); create table t2(id int); @@ -2519,12 +2382,6 @@ sum(a+b) 1296 explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00 -Warnings: -Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where <`test`.`up`.`a`>((`test`.`up`.`a`,`test`.`up`.`a` in ( (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where 1 ), (`test`.`up`.`a` in on distinct_key where `test`.`up`.`a` = ``.`a`)))) drop table t1; CREATE TABLE t1 (t1_a int); INSERT INTO t1 VALUES (1); @@ -2694,16 +2551,10 @@ insert into t1 values (1,1,1), (2,2,2), (3,3,3); set @b:= 0; explain select sum(a) from t1 where b > @b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index set @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; @@ -3067,23 +2918,8 @@ 10 5 NULL 10 10 NULL explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) AS `test` from `test`.`t1` explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` where <`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = 'N' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<`test`.`t1`.`one`,`test`.`t1`.`two`>(((`test`.`t1`.`one`,`test`.`t1`.`two`),(`test`.`t1`.`one`,`test`.`t1`.`two`) in ( (/* select#2 */ select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where `test`.`t2`.`flag` = '0' ), (`test`.`t1`.`one` in on distinct_key where `test`.`t1`.`one` = ``.`one` and `test`.`t1`.`two` = ``.`two`)))) AS `test` from `test`.`t1` DROP TABLE t1,t2; set optimizer_switch=@tmp11867_optimizer_switch; CREATE TABLE t1 (a char(5), b char(5)); @@ -3207,10 +3043,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3219,10 +3051,6 @@ explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -3271,9 +3099,6 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) 1 1 @@ -3306,9 +3131,6 @@ 1 2 EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (2), (4), (1), (3); @@ -3671,9 +3493,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary ALTER TABLE t1 ADD INDEX(a); SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); a b @@ -3682,9 +3501,6 @@ AAA 8 EXPLAIN SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary DROP TABLE t1; create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); @@ -3804,10 +3620,6 @@ WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 ORDER BY t1.t DESC LIMIT 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t1 index NULL PRIMARY 13 NULL 11 Using where; Using index -2 SUBQUERY t1 range PRIMARY PRIMARY 13 NULL 6 Using where; Using index SELECT * FROM t1,t2 WHERE t1.t = (SELECT t1.t FROM t1 WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 @@ -3829,18 +3641,8 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); insert into t1 (a) values (FLOOR(rand() * 100)); @@ -4303,9 +4105,6 @@ CREATE TABLE t1 (a int, b int, KEY (a)); INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -4341,11 +4140,6 @@ INSERT INTO t1 VALUES (1), (2); EXPLAIN EXTENDED SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `res`.`count(*)` AS `count(*)` from (/* select#2 */ select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` DROP TABLE t1; CREATE TABLE t1 ( a varchar(255) default NULL, @@ -4480,9 +4274,6 @@ CREATE INDEX I1 ON t1 (a); CREATE INDEX I2 ON t1 (b); EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); a b CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)) CHARSET=latin1; @@ -4490,16 +4281,10 @@ CREATE INDEX I1 ON t2 (a); CREATE INDEX I2 ON t2 (b); EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); -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 t2 index_subquery I1 I1 4 func 1 Using index; Using where SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); a b EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); a b DROP TABLE t1,t2; @@ -4519,9 +4304,6 @@ SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where SELECT a AS out_a, MIN(b) FROM t1 t1_outer WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) GROUP BY a; @@ -4542,24 +4324,9 @@ 2 EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where 1 ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`a`)))) EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where -3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 -Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <`test`.`t1`.`a`>(exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1)) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4635,17 +4402,7 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); -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 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 0 SET join_cache_level=@save_join_cache_level; DROP TABLE t1; # @@ -4666,8 +4423,6 @@ 5 5 0 0 EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE C ALL NULL NULL NULL NULL 20 100.00 Using where DROP TABLE C; # End of test for bug#45061. # @@ -4688,9 +4443,6 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; @@ -4710,10 +4462,6 @@ SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) ORDER BY outr.pk; -id select_type table type possible_keys key key_len ref rows Extra -x x outr ALL x x x x x x -x x t1 eq_ref x x x x x x -x x t2 index x x x x x x # should not crash on debug binaries SELECT * FROM t2 outr WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) @@ -4732,11 +4480,6 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 1 SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); 1 1 @@ -5080,10 +4823,6 @@ INSERT INTO t3 VALUES (1,1,1), (2,32,1), (3,33,1), (4,34,2); explain SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index -1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; a incorrect 1 1 @@ -5778,11 +5517,6 @@ explain SELECT * FROM ot1,ot4 WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED it2 ALL NULL NULL NULL NULL 4 -2 MATERIALIZED it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery @@ -5799,9 +5533,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502 SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); a @@ -5809,9 +5540,6 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t2 index_subquery idx idx 5 func 58 Using index DROP TABLE t1,t2; # # BUG#752992: Wrong results for a subquery with 'semijoin=on' @@ -5827,10 +5555,6 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 @@ -5850,9 +5574,6 @@ SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT b FROM t1 WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) GROUP BY b; @@ -6093,12 +5814,7 @@ CREATE TABLE t1 (a INT, b INT, INDEX (a)); INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 1 EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6113,10 +5829,6 @@ SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); @@ -6169,9 +5881,6 @@ SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 1 Using index; Using where SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6181,9 +5890,6 @@ SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ot system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY it2 index_subquery idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 func,const 1 Using index; Using where SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); @@ -6227,8 +5933,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6241,9 +5945,6 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6264,9 +5965,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6286,9 +5984,6 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) @@ -6337,10 +6032,6 @@ SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT t2.b , t1.c FROM t2 LEFT JOIN t1 ON t1.c < 3 WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); @@ -6359,15 +6050,9 @@ set @tmp_optimizer_switch=@@optimizer_switch; set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ref a a 5 const 1 set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6496,10 +6181,6 @@ SELECT DISTINCT f1_key FROM t2 WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY table1 ALL NULL NULL NULL NULL 2 -1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index DROP TABLE t1,t2; # # lp:826279: assertion failure with GROUP BY a result of subquery @@ -6751,18 +6432,12 @@ set @old_optimizer_switch = @@optimizer_switch; SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 2009-02-02 SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index -2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); a 2009-01-01 @@ -6815,33 +6490,21 @@ INSERT INTO t2 VALUES (3,'f'); EXPLAIN SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 NULL EXPLAIN SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 EXPLAIN SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 1 EXPLAIN SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; COUNT(f1) f4 0 0 @@ -6855,12 +6518,6 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; f1 f2 drop table t1,t2; @@ -6872,20 +6529,10 @@ INSERT INTO t1 VALUES (1),(7); EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used -3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; min_a a EXPLAIN SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where -NULL UNION RESULT ALL NULL NULL NULL NULL NULL SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; min_a a drop table t1; @@ -6944,9 +6591,6 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) AS field FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR alias1.a = 'y' @@ -6956,11 +6600,6 @@ SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index -1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index -1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where SELECT MAX( alias2.a ) FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); @@ -6978,12 +6617,6 @@ EXPLAIN SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); a1 @@ -7004,13 +6637,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7047,13 +6673,6 @@ (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 -1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; flush global status; SELECT @@ -7094,10 +6713,6 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; @@ -7116,11 +6731,6 @@ explain SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where -1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @tmp_mdev410=@@global.userstat; set global userstat=on; flush table_statistics; @@ -7149,10 +6759,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields @@ -7166,11 +6772,6 @@ EXPLAIN SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY ALL distinct_key NULL NULL NULL 1 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; a @@ -7183,10 +6784,6 @@ CREATE TABLE t2 (b INT, KEY(b)); INSERT INTO t2 VALUES (45),(17),(20); EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index DROP TABLE t1,t2; # # MDEV-5991: crash in Item_field::used_tables @@ -7392,13 +6989,7 @@ create table t2 (b int, index idx(b)); insert into t2 values (2), (5), (3), (2); explain select * from t1 where (select max(b) from t2) = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; # # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 @@ -7410,9 +7001,6 @@ select * from t10 where exists (select * from t12 order by a limit 0); a explain select * from t10 where exists (select * from t12 order by a limit 0); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; set @l=1; execute stmt1 using @l; @@ -7660,64 +7248,6 @@ SET optimizer_switch='subquery_cache=off'; explain format=json SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "pseudo_bits_condition": "1 = t1.a or (1,(subquery#3))", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "system", - "rows": 1, - "filtered": 100 - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "1 = t3.c" - } - } - ] - } - } - ] - } - } - ] - } -} SET optimizer_switch=@tmp19714; drop table t1,t2,t3; set @optimizer_switch_for_subselect_test=null; Result length mismatch mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_partial_match' mysql-test-run: restarting replay server... - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_semijoin/' Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 200945 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: 19071 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 mysql-test-run: replay server restarted (pid 200945) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_partial_match [ pass ] 414 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_sj_jcl6 [ fail ] Test ended at 2026-04-23 23:17:35 CURRENT_TEST: main.subselect_sj_jcl6 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj_jcl6.result 2026-04-02 14:38:09.488657291 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj_jcl6.reject 2026-04-23 23:17:34.836232037 +0300 @@ -782,8 +782,6 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) show warnings; Level Code Message -Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -2581,7 +2579,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 index b b 5 NULL 10 Using where; Using index; Start temporary 1 PRIMARY t4 ref c c 5 test.t3.b 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 PRIMARY t1 ALL b NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join) +1 PRIMARY t1 ref b b 5 test.t3.b 2 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t2 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (incremental, BNL join) SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj_jcl6/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist ReplayTest: Loading context main.subselect_sj_mat [ fail ] Test ended at 2026-04-23 23:17:36 CURRENT_TEST: main.subselect_sj_mat --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj_mat.result 2026-04-02 14:38:09.488657291 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj_mat.reject 2026-04-23 23:17:36.255639095 +0300 @@ -107,7 +107,7 @@ explain extended select * from t1i where a1 in (select b1 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2i index it2i1,it2i3 it2i1 # NULL 5 50.00 Using where; Using index; LooseScan +1 PRIMARY t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 20.00 Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` > '0' @@ -130,7 +130,7 @@ explain extended select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 50.00 Using where; Using index; LooseScan +1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 100.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 20.00 Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' @@ -276,7 +276,7 @@ explain extended select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 50.00 Using where; Using index; LooseScan +1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 100.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref it1i1,it1i2,it1i3 it1i3 18 test.t2i.b1,test.t2i.b2 1 20.00 Using index Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` @@ -332,7 +332,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 4 25.00 Using where; End temporary; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3`.`c2` = `test`.`t1`.`a2` and `test`.`t1`.`a1` > '0' and `test`.`t1`.`a2` > '0' select * from t1 @@ -348,10 +348,10 @@ (a1, a2) in (select c1, c2 from t3i where (c1, c2) in (select b1, b2 from t2i where b2 > '0')); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2i index it2i1,it2i2,it2i3 # # # 5 50.00 # +1 PRIMARY t2i index it2i1,it2i2,it2i3 # # # 5 100.00 # 1 PRIMARY t1i ref it1i1,it1i2,it1i3 # # # 1 20.00 # 1 PRIMARY t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # -1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 60.00 # +1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0' select * from t1i @@ -372,7 +372,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 4 25.00 Using where; End temporary; Using join buffer (flat, BNL join) 4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: @@ -393,16 +393,15 @@ (a1, a2) in (select c1, c2 from t3 t3c where (c1, c2) in (select b1, b2 from t2i where b2 > '0')); 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 5 20.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 16 func,func 1 100.00 -5 MATERIALIZED t3c ALL NULL NULL NULL NULL 4 100.00 Using where -5 MATERIALIZED t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t3c.c1,test.t3c.c2 1 100.00 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3c ALL NULL NULL NULL NULL 4 5.00 Using where; End temporary; Using join buffer (flat, BNL join) 4 MATERIALIZED t3b ALL NULL NULL NULL NULL 4 100.00 Using where 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b1` = `test`.`t3c`.`c1` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t2i`.`b2` = `test`.`t3c`.`c2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t3c`.`c2` > '0' +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t1`.`a2` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 t3a where c1 = a1) or @@ -429,13 +428,13 @@ 1 PRIMARY t1 ALL NULL # # # 3 100.00 # 1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # 1 PRIMARY t2 ALL NULL # # # 5 20.00 # -1 PRIMARY t3 ALL NULL # # # 4 15.00 # +1 PRIMARY t3 ALL NULL # # # 4 25.00 # 4 MATERIALIZED t3 ALL NULL # # # 4 100.00 # 3 MATERIALIZED t3 ALL NULL # # # 4 100.00 # -7 UNION t2i index it2i1,it2i2,it2i3 # # # 5 50.00 # +7 UNION t2i index it2i1,it2i2,it2i3 # # # 5 100.00 # 7 UNION t1i ref it1i1,it1i2,it1i3 # # # 1 20.00 # 7 UNION t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # -7 UNION t2i ref it2i1,it2i2,it2i3 # # # 1 60.00 # +7 UNION t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # NULL UNION RESULT ALL NULL # # # NULL NULL # Warnings: Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3`.`c2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`)))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) and `test`.`t1`.`a2` > '0') union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0') @@ -530,22 +529,22 @@ where (c1, c2) in (select b1, b2 from t2i where b2 > '0' or b2 = a2)); 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 5 20.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) 1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary -1 PRIMARY t3c ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3c ALL NULL NULL NULL NULL 4 5.00 Using where; End temporary; Using join buffer (flat, BNL join) 4 MATERIALIZED t3b ALL NULL NULL NULL NULL 4 100.00 Using where 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a2' of SELECT #6 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and (<`test`.`t2`.`b2`,`test`.`t1`.`a1`>((`test`.`t2`.`b2`,(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and (`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <`test`.`t2`.`b2`>((`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), (`test`.`t2`.`b2` in on distinct_key where `test`.`t2`.`b2` = ``.`c2`))))) explain extended select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); 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 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = '2 - 01' or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = convert('1 - 01' using latin1) or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = convert('2 - 01' using latin1) or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); a1 a2 1 - 01 2 - 01 @@ -555,7 +554,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = '1 - 01' or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = '2 - 01' or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <`test`.`t1`.`a1`,`test`.`t1`.`a2`>(((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(/* select#2 */ select '1 - 01','2 - 01' having ((`test`.`t1`.`a1`) = convert('1 - 01' using latin1) or /*always not null*/ 1 is null) and ((`test`.`t1`.`a2`) = convert('2 - 01' using latin1) or /*always not null*/ 1 is null) and '1 - 01' is null and '2 - 01' is null))) select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual); a1 a2 1 - 01 2 - 01 @@ -704,10 +703,9 @@ where a1 in (select group_concat(b1) from t2_16 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_16.a1 1 100.00 Using where -2 MATERIALIZED t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2`) join `test`.`t1_16` where `test`.`t1_16`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` where <`test`.`t1_16`.`a1`>((`test`.`t1_16`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_16`.`b1` separator ',') from `test`.`t2_16` group by `test`.`t2_16`.`b2` having (`test`.`t1_16`.`a1`) = (group_concat(`test`.`t2_16`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_16 where a1 in (select group_concat(b1) from t2_16 group by b2); @@ -804,10 +802,9 @@ where a1 in (select group_concat(b1) from t2_512 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_512.a1 1 100.00 Using where -2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where `test`.`t1_512`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` having (`test`.`t1_512`.`a1`) = (group_concat(`test`.`t2_512`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -822,10 +819,9 @@ where a1 in (select group_concat(b1) from t2_512 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_512.a1 1 100.00 Using where -2 MATERIALIZED t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2`) join `test`.`t1_512` where `test`.`t1_512`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` where <`test`.`t1_512`.`a1`>((`test`.`t1_512`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_512`.`b1` separator ',') from `test`.`t2_512` group by `test`.`t2_512`.`b2` having (`test`.`t1_512`.`a1`) = (group_concat(`test`.`t2_512`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_512 where a1 in (select group_concat(b1) from t2_512 group by b2); @@ -907,10 +903,9 @@ where a1 in (select group_concat(b1) from t2_1024 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1024.a1 1 100.00 Using where -2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` having (`test`.`t1_1024`.`a1`) = (group_concat(`test`.`t2_1024`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -926,10 +921,9 @@ where a1 in (select group_concat(b1) from t2_1024 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1024.a1 1 100.00 Using where -2 MATERIALIZED t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2`) join `test`.`t1_1024` where `test`.`t1_1024`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` where <`test`.`t1_1024`.`a1`>((`test`.`t1_1024`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1024`.`b1` separator ',') from `test`.`t2_1024` group by `test`.`t2_1024`.`b2` having (`test`.`t1_1024`.`a1`) = (group_concat(`test`.`t2_1024`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1024 where a1 in (select group_concat(b1) from t2_1024 group by b2); @@ -1012,10 +1006,9 @@ where a1 in (select group_concat(b1) from t2_1025 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1025.a1 1 100.00 Using where -2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` having (`test`.`t1_1025`.`a1`) = (group_concat(`test`.`t2_1025`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -1031,10 +1024,9 @@ where a1 in (select group_concat(b1) from t2_1025 group by b2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 260 test.t1_1025.a1 1 100.00 Using where -2 MATERIALIZED t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort +2 DEPENDENT SUBQUERY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using filesort Warnings: -Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from (/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2`) join `test`.`t1_1025` where `test`.`t1_1025`.`a1` = ``.`group_concat(b1)` +Note 1003 /* select#1 */ select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` where <`test`.`t1_1025`.`a1`>((`test`.`t1_1025`.`a1`,(/* select#2 */ select group_concat(`test`.`t2_1025`.`b1` separator ',') from `test`.`t2_1025` group by `test`.`t2_1025`.`b2` having (`test`.`t1_1025`.`a1`) = (group_concat(`test`.`t2_1025`.`b1` separator ','))))) select left(a1,7), left(a2,7) from t1_1025 where a1 in (select group_concat(b1) from t2_1025 group by b2); @@ -2026,10 +2018,7 @@ WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 WHERE s2.d = s1.e AND s1.e = (SELECT MAX(e) FROM t2)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 index c c 5 NULL 8 Using where; Using index -1 PRIMARY s1 ref c c 5 test.t2.c 1 Using where -1 PRIMARY s2 ref d d 4 const 2 Using where; Using index; FirstMatch(t2) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 SUBQUERY t2 ALL NULL NULL NULL NULL 8 SELECT a, c FROM t1, t2 WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 @@ -2045,10 +2034,7 @@ WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 WHERE s2.d = s1.e AND s1.e = (SELECT MAX(e) FROM t2)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 index c c 5 NULL 8 Using where; Using index -1 PRIMARY s1 hash_ALL c #hash#c 5 test.t2.c 8 Using where; Using join buffer (flat, BNLH join) -1 PRIMARY s2 hash_range d #hash#d:d 4:4 const 2 Using where; Using index; FirstMatch(t2); Using join buffer (incremental, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 3 SUBQUERY t2 ALL NULL NULL NULL NULL 8 SELECT a, c FROM t1, t2 WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2 @@ -2596,13 +2582,7 @@ explain extended select * from t1 left join t4 on t1.b = t4.id where f1(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f1`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f1 does not exist # Non-deterministic function in left part of IN subq: semi-join is OK select * from t1 left join t4 on t1.b = t4.id @@ -2614,13 +2594,7 @@ explain extended select * from t1 left join t4 on t1.b = t4.id where f2(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f2`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f2 does not exist select t1.*, t4.*, (select max(t4.id) from t4 where t4.id=t1.b and sleep(0) = 0) as s from t1 left join t4 on t1.b = t4.id @@ -2633,15 +2607,7 @@ (select max(t4.id) from t4 where t4.id=t1.b and sleep(0) = 0) as s from t1 left join t4 on t1.b = t4.id where f2(t1.id, '1980-01-01') in (select id from t2 where x=1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 Using where -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where -2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1276 Field or reference 'test.t1.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t4`.`id` AS `id`,`test`.`t4`.`a` AS `a`,(/* select#2 */ select max(`test`.`t4`.`id`) from `test`.`t4` where `test`.`t4`.`id` = `test`.`t1`.`b` and sleep(0) = 0) AS `s` from `test`.`t1` semi join (`test`.`t2`) left join `test`.`t4` on(`test`.`t4`.`id` = `test`.`t1`.`b`) where `test`.`t2`.`x` = 1 and `f2`(`test`.`t1`.`id`,'1980-01-01') = `test`.`t2`.`id` +ReplayTest: Query error: FUNCTION test.f2 does not exist drop function f1; drop function f2; drop table t1,t2,t3,t4; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj_mat/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.table_elim [ fail ] Test ended at 2026-04-23 23:17:38 CURRENT_TEST: main.table_elim --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/table_elim.result 2026-04-02 14:38:09.492657280 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/table_elim.reject 2026-04-23 23:17:38.756618619 +0300 @@ -247,11 +247,7 @@ insert into t2 values ('FOO'); this must not use table elimination: explain select t1.* from t1 left join t2 on t2.a='foo' collate latin1_general_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 10 NULL 2 Using index -1 SIMPLE t2 index PRIMARY PRIMARY 10 NULL 2 Using where; Using index -Warnings: -Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of collation `latin1_general_cs` = "'foo' collate latin1_general_ci" of collation `latin1_general_ci` +ReplayTest: Query error: COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8mb4' this must not use table elimination: explain select t1.* from t1 left join t2 on t2.a=t1.a collate latin1_general_ci; id select_type table type possible_keys key key_len ref rows Extra Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.table_elim/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Table 'seq_1_to_1000000' already exists ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/user_var.test" ReplayTest: At line 522 main.user_var [ fail ] Test ended at 2026-04-23 23:17:39 CURRENT_TEST: main.user_var --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/user_var.result 2026-04-17 18:40:40.526804062 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/user_var.reject 2026-04-23 23:17:39.285614322 +0300 @@ -22,7 +22,7 @@ 2 1 0 0 1 explain select * from t1 where i=@vv1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 2 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables select @vv1,i,v from t1 where i=@vv1; @vv1 i v 1 1 1 @@ -35,7 +35,7 @@ 1 SIMPLE t1 index NULL i 4 NULL 3 Using where; Using index explain select * from t1 where i=@vv1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 2 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1,t2; set @a=0,@b=0; select @a:=10, @b:=1, @a > @b, @a < @b; @@ -576,8 +576,6 @@ set @var= repeat('a',30000); 1 explain select @a:=max(seq) from seq_1_to_1000000; -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 # # Start of 10.3 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.user_var/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.vector2 [ pass ] 541 main.vector_subdist [ pass ] 752 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.win [ fail ] Test ended at 2026-04-23 23:17:45 CURRENT_TEST: main.win --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/win.result 2026-04-17 18:40:40.532804433 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/win.reject 2026-04-23 23:17:45.453565089 +0300 @@ -3212,7 +3212,7 @@ explain select sum(max(id)) over (order by max(id)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select sum(max(id)) over (order by max(id)) from t1 where id < 3; sum(max(id)) over (order by max(id)) 2 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.win/' main.warnings [ pass ] 77 main.skip_log_bin [ pass ] 47 ReplayTest: Loading context main.partition_disabled [ pass ] 32 main.myisam_crash_before_flush_keys [ pass ] 273 main.variables-notembedded [ pass ] 69 main.ssl_system_ca 'bad' [ pass ] 77 main.ssl_8k_key [ pass ] 98 main.ssl_timeout-9836 [ pass ] 2041 main.thread_pool_info [ pass ] 1476 main.ssl_cipher [ pass ] 3420 main.mysql_json_table_recreate [ pass ] 2354 main.mysql_upgrade_mysql_json_with_plugin_loaded [ pass ] 3191 main.lowercase_mixed_tmpdir [ pass ] 34 main.grant_lowercase [ pass ] 41 main.lowercase_view [ pass ] 64 main.lowercase_table [ pass ] 71 main.lowercase_table_grant [ pass ] 18 main.lowercase_table_qcache [ pass ] 17 main.master_retry_count_basic [ pass ] 1483 ReplayTest: Loading context 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.variables [ fail ] Test ended at 2026-04-23 23:18:31 CURRENT_TEST: main.variables --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/variables.result 2026-04-17 18:40:40.526804062 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/variables.reject 2026-04-23 23:18:31.106825412 +0300 @@ -1527,7 +1527,7 @@ set sql_buffer_result=1; explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0); one @@ -1779,22 +1779,22 @@ 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 @@VERsion AS "@@VERsion" from DUAL where rand() > @@version +Note 1003 select @@VERsion AS `@@VERsion` from DUAL where rand() > @@version explain extended select @@SESsion.SQL_mode from dual where rand() > @@sesSION.sql_MODE; 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 @@SESsion.SQL_mode AS "@@SESsion.SQL_mode" from DUAL where rand() > @@sql_mode +Note 1003 select @@SESsion.SQL_mode AS `@@SESsion.SQL_mode` from DUAL where rand() > @@sql_mode explain extended select @@GLObal.COLLATION_connection from dual where rand() > @@gloBAL.collation_CONNECTION; 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 @@GLObal.COLLATION_connection AS "@@GLObal.COLLATION_connection" from DUAL where rand() > @@global.collation_connection +Note 1003 select @@GLObal.COLLATION_connection AS `@@GLObal.COLLATION_connection` from DUAL where rand() > @@global.collation_connection explain extended select @@FOObar.KEY_BUFfer_size from dual where rand() > @@fooBAR.key_bufFER_SIZE; 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 @@FOObar.KEY_BUFfer_size AS "@@FOObar.KEY_BUFfer_size" from DUAL where rand() > @@fooBAR.key_buffer_size +Note 1003 select @@FOObar.KEY_BUFfer_size AS `@@FOObar.KEY_BUFfer_size` from DUAL where rand() > @@fooBAR.key_buffer_size # # MDEV-15316 Assertion `(thd->lex)->var_list.is_empty()' failed in MYSQLparse # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.variables/' main.user_limits [ pass ] 101 main.count_distinct2 [ pass ] 751 main.multi_update_tiny_hash [ pass ] 26 main.myisam_recover [ pass ] 345 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.myisam [ fail ] Test ended at 2026-04-23 23:18:38 CURRENT_TEST: main.myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/myisam.result 2026-04-17 18:40:40.440798748 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/myisam.reject 2026-04-23 23:18:38.075205303 +0300 @@ -1260,7 +1260,9 @@ 1 SIMPLE t1 ref t t 13 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 533. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 13 const # Using where; Using index @@ -1456,7 +1458,9 @@ 1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # Using where; Using index @@ -1536,7 +1540,9 @@ 1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.myisam/' ***Warnings generated in error logs during shutdown after running tests: main.myisam 2026-04-23 23:18:38 4 [ERROR] Got an error from thread_id=4, /home/psergey/dev-git/11.8-skip-records-in-range/storage/myisam/ha_myisam.cc:1097 2026-04-23 23:18:38 4 [ERROR] MariaDB thread id 4, OS thread handle 140133715232448, query id 3060 localhost root Checking table 2026-04-23 23:18:38 4 [ERROR] mariadbd: Table './test/t1' is marked as crashed and should be repaired main.old-mode [ pass ] 60 main.plugin_auth_qa [ pass ] 86 main.plugin_auth_qa_1 [ pass ] 701 main.plugin_auth_qa_2 [ pass ] 420 main.plugin_auth_qa_3 [ pass ] 96 main.plugin_maturity [ pass ] 10 main.handlersocket [ pass ] 15 main.plugin [ pass ] 77 main.plugin_not_embedded [ pass ] 1443 main.truncate_badse [ pass ] 6 main.query_cache_notembedded [ pass ] 6191 main.bug58669 [ pass ] 16 main.require_secure_transport [ pass ] 46 main.require_secure_transport_on [ pass ] 35 main.grant3 [ pass ] 116 main.secure_file_priv_win [ skipped ] Need windows main.skip_grants [ pass ] 4300 main.udf_skip_grants [ pass ] 2 main.flush2 [ pass ] 15 main.mysqldump-no-binlog [ pass ] 64 main.kill-2 [ pass ] 27 main.skip_name_resolve [ pass ] 17 main.my_getopt_case_insensitive [ pass ] 7 main.mysqlslap [ pass ] 3058 main.chained_ssl_certificates [ pass ] 2791 main.ssl_crl 'file' [ pass ] 77 main.ssl_crl 'path' [ pass ] 71 main.wolfssl [ pass ] 9 main.sysdate_is_now [ pass ] 1008 main.no-threads [ pass ] 9 main.shutdown_debug '1tpc' [ pass ] 1553 main.mdev-21101 [ pass ] 3317 main.shutdown_debug 'pot' [ pass ] 1537 main.tls_version [ pass ] 379 main.long_tmpdir [ pass ] 8 main.trans_read_only [ pass ] 33 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.selectivity_no_engine [ fail ] Test ended at 2026-04-23 23:20:00 CURRENT_TEST: main.selectivity_no_engine --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_no_engine.result 2026-04-02 14:38:09.454657383 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_no_engine.reject 2026-04-23 23:19:59.832825248 +0300 @@ -64,25 +64,25 @@ # Should select about 10%: 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 1000 9.52 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 18.18 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 # Should select about 10%: explain extended select * from t1 where a=1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 18.18 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Must not have filtered=100%: 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 1000 9.52 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 18.18 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 # Again, must not have filtered=100%: explain extended select * from t1 where a=-1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.52 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 18.18 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = -1 drop table t0, t1; @@ -103,18 +103,18 @@ test.t1 analyze status OK explain extended select * from t1 where col1 in (1,2,3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 2.97 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 3.00 Using where Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (1,2,3) # Must not cause fp division by zero, or produce nonsense numbers: explain extended select * from t1 where col1 in (-1,-2,-3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 5.94 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 11.76 Using where Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (-1,-2,-3) explain extended select * from t1 where col1<=-1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 1.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 1.96 Using where Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` <= -1 drop table t1, t2; @@ -156,7 +156,7 @@ # 10% is ok explain extended select * from t1 where col1=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 9.90 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 19.61 Using where Warnings: Note 1003 select `test`.`t1`.`key1` AS `key1`,`test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` = 2 # Must show 100%, not 10% @@ -266,15 +266,15 @@ # Filtered will be 4.95, 9.90 explain extended select * from t1 ta, t2 tb where ta.a < 40 and tb.a < 100; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE ta ALL NULL NULL NULL NULL 1000 4.95 Using where -1 SIMPLE tb ALL NULL NULL NULL NULL 1000 9.90 Using where; Using join buffer (flat, BNL join) +1 SIMPLE ta ALL NULL NULL NULL NULL 1000 9.80 Using where +1 SIMPLE tb ALL NULL NULL NULL NULL 1000 19.61 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where `test`.`ta`.`a` < 40 and `test`.`tb`.`a` < 100 # Here, tb.filtered should not become 100%: explain extended select * from t1 ta, t2 tb where ta.a < 40 and tb.a < 100 and tb.a=ta.a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE ta ALL NULL NULL NULL NULL 1000 4.95 Using where -1 SIMPLE tb ALL NULL NULL NULL NULL 1000 4.95 Using where; Using join buffer (flat, BNL join) +1 SIMPLE ta ALL NULL NULL NULL NULL 1000 9.80 Using where +1 SIMPLE tb ALL NULL NULL NULL NULL 1000 9.80 Using where; Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`ta`.`a` AS `a`,`test`.`tb`.`a` AS `a` from `test`.`t1` `ta` join `test`.`t2` `tb` where `test`.`tb`.`a` = `test`.`ta`.`a` and `test`.`ta`.`a` < 40 and `test`.`ta`.`a` < 100 drop table t0,t1,t2; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_no_engine/' main.stat_tables_par [ pass ] 2445 main.mysqldump-compat-102 [ pass ] 67 main.analyze_format_json_emb [ skipped ] Test requires: embedded server main.count_distinct3 [ pass ] 12390 main.create_delayed [ pass ] 2621 main.flush_corruption [ pass ] 36065 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'c' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer.test" ReplayTest: At line 1543 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context 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_outer [ fail ] Test ended at 2026-04-23 23:21:41 CURRENT_TEST: main.join_outer --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer.result 2026-04-17 18:40:40.432798253 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer.reject 2026-04-23 23:21:41.372577145 +0300 @@ -1960,10 +1960,6 @@ NULL EXPLAIN SELECT t2.b FROM t1 LEFT JOIN t2 ON (t2.b) IN (SELECT c2 from t3) AND t2.a = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 const PRIMARY PRIMARY 4 const 1 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b FROM t1 LEFT JOIN t2 ON (t2.b) IN (SELECT c2 from t3) AND t2.a = 1; b @@ -2359,11 +2355,7 @@ FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x WHERE IFNULL(t2.x,0)=0; -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 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x`) where ifnull(`test`.`t2`.`x`,0) = 0 +ReplayTest: Query error: FUNCTION test.f does not exist SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0) FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x @@ -2375,11 +2367,7 @@ FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x WHERE f(t2.x,0)=0; -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 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x`) where `f`(`test`.`t2`.`x`,0) = 0 +ReplayTest: Query error: FUNCTION test.f does not exist drop function f; drop table t; CREATE TABLE t1 ( @@ -2429,11 +2417,7 @@ EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3 FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2 WHERE f1(t2.col3,0) = 0; -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 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0 +ReplayTest: Query error: FUNCTION test.f1 does not exist DROP FUNCTION f1; DROP TABLE t1,t2; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_outer/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'c' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer_jcl6.test at line 17: ReplayTest: At line 1543 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context 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_outer_jcl6 [ fail ] Test ended at 2026-04-23 23:21:56 CURRENT_TEST: main.join_outer_jcl6 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer_jcl6.result 2026-04-17 18:40:40.433798315 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_outer_jcl6.reject 2026-04-23 23:21:56.016557086 +0300 @@ -1967,10 +1967,6 @@ NULL EXPLAIN SELECT t2.b FROM t1 LEFT JOIN t2 ON (t2.b) IN (SELECT c2 from t3) AND t2.a = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY t2 const PRIMARY PRIMARY 4 const 1 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where SELECT t2.b FROM t1 LEFT JOIN t2 ON (t2.b) IN (SELECT c2 from t3) AND t2.a = 1; b @@ -2366,11 +2362,7 @@ FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x WHERE IFNULL(t2.x,0)=0; -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 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join) -Warnings: -Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where ifnull(`test`.`t2`.`x`,0) = 0 +ReplayTest: Query error: FUNCTION test.f does not exist SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0) FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x @@ -2382,11 +2374,7 @@ FROM t t1 LEFT JOIN t t2 ON t1.x = t2.x WHERE f(t2.x,0)=0; -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 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join) -Warnings: -Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where `f`(`test`.`t2`.`x`,0) = 0 +ReplayTest: Query error: FUNCTION test.f does not exist drop function f; drop table t; CREATE TABLE t1 ( @@ -2436,11 +2424,7 @@ EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3 FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2 WHERE f1(t2.col3,0) = 0; -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 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join) -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where `f1`(`test`.`t2`.`col3`,0) = 0 +ReplayTest: Query error: FUNCTION test.f1 does not exist DROP FUNCTION f1; DROP TABLE t1,t2; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_outer_jcl6/' main.long_unique_big [ pass ] 4063 main.myisam-big [ pass ] 3907 main.query_cache_debug [ pass ] 80 main.ssl-big [ pass ] 49916 main.type_newdecimal-big [ pass ] 2667 main.1st [ pass ] 1 ReplayTest: Loading context ReplayTest: Loading context main.a1 [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context main.a2 [ pass ] 12 main.aborted_clients [ pass ] 10 main.adddate_454 [ pass ] 9 main.alias [ pass ] 41 main.almost_full [ pass ] 39 main.alter_table_combinations 'aria' [ pass ] 55 main.alter_table_combinations 'heap' [ pass ] 34 main.alter_table_debug [ pass ] 18 main.alter_table_locknone_notembedded [ pass ] 31 main.alter_table_mdev539_maria [ pass ] 2192 main.alter_table_mdev539_myisam [ pass ] 845 main.alter_table_upgrade_aria [ pass ] 22 main.alter_table_upgrade_myisam [ pass ] 13 main.alter_table_upgrade_myisam_debug [ pass ] 24 main.alter_user [ pass ] 44 main.analyze_debug [ pass ] 9 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.analyze_stmt [ fail ] Test ended at 2026-04-23 23:23:55 CURRENT_TEST: main.analyze_stmt --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/analyze_stmt.result 2026-04-02 14:38:09.276657865 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/analyze_stmt.reject 2026-04-23 23:23:55.595502527 +0300 @@ -329,7 +329,7 @@ insert into t1 values (1),(2); explain delete from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL 2 Deleting all rows +1 SIMPLE NULL NULL NULL NULL NULL NULL 0 Deleting all rows select * from t1; i 1 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.analyze_stmt/' main.analyze_stmt_privileges [ pass ] 41 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'privtest_db.v1' doesn't exist ReplayTest: Failed query was: EXPLAIN INSERT INTO v1 (a) VALUES (10) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'privtest_db.v2' doesn't exist ReplayTest: Failed query was: EXPLAIN INSERT INTO v2 (a) VALUES (10) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.analyze_stmt_privileges2 [ fail ] Test ended at 2026-04-23 23:23:58 CURRENT_TEST: main.analyze_stmt_privileges2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/analyze_stmt_privileges2.result 2026-04-02 14:38:09.277657862 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/analyze_stmt_privileges2.reject 2026-04-23 23:23:58.204325721 +0300 @@ -388,8 +388,7 @@ #------------------------------------------------------------------------ INSERT INTO v1 (a) VALUES (10); EXPLAIN INSERT INTO v1 (a) VALUES (10); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'privtest_db.v1' doesn't exist ANALYZE INSERT INTO v1 (a) VALUES (10); id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL @@ -410,7 +409,7 @@ REPLACE INTO v1 SELECT * FROM t2; EXPLAIN REPLACE INTO v1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v1 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -501,8 +500,7 @@ #------------------------------------------------------------------------ INSERT INTO v2 (a) VALUES (10); EXPLAIN INSERT INTO v2 (a) VALUES (10); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'privtest_db.v2' doesn't exist ANALYZE INSERT INTO v2 (a) VALUES (10); id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL 100.00 100.00 NULL @@ -523,7 +521,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -1506,7 +1504,7 @@ REPLACE INTO v1 SELECT * FROM t2; EXPLAIN REPLACE INTO v1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v1 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -1621,7 +1619,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -1743,7 +1741,7 @@ REPLACE INTO t1 SELECT * FROM t2; EXPLAIN REPLACE INTO t1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO t1 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -1851,7 +1849,7 @@ REPLACE INTO v1 SELECT * FROM t2; EXPLAIN REPLACE INTO v1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v1 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -1965,7 +1963,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -2717,7 +2715,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -3891,7 +3889,7 @@ REPLACE INTO v1 SELECT * FROM t2; EXPLAIN REPLACE INTO v1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v1 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -4004,7 +4002,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 @@ -5127,7 +5125,7 @@ REPLACE INTO v2 SELECT * FROM t2; EXPLAIN REPLACE INTO v2 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found ANALYZE REPLACE INTO v2 SELECT * FROM t2; 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 3 3.00 100.00 100.00 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.analyze_stmt_privileges2/' 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.ansi [ fail ] Test ended at 2026-04-23 23:23:59 CURRENT_TEST: main.ansi --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ansi.result 2026-04-02 14:38:09.277657862 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ansi.reject 2026-04-23 23:23:59.522503491 +0300 @@ -60,12 +60,12 @@ 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 -1 << concat(1,1) AS "a" +Note 1003 select -1 << 1 or 1 AS `a` EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL; 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 concat(-1,0) << 1 AS "a" +Note 1003 select -1 or 0 << 1 AS `a` SELECT -1+1||1 AS a FROM DUAL; a 10 @@ -76,12 +76,12 @@ 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 -1 + concat(1,1) AS "a" +Note 1003 select -1 + 1 or 1 AS `a` EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL; 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 concat(-1,0) + 1 AS "a" +Note 1003 select -1 or 0 + 1 AS `a` SELECT 1*1||-1 AS a FROM DUAL; a 1 @@ -94,12 +94,12 @@ 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 1 * concat(1,-1) AS "a" +Note 1003 select 1 * 1 or -1 AS `a` EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL; 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 concat(1,1) * -1 AS "a" +Note 1003 select 1 or 1 * -1 AS `a` SELECT -1^1||1 AS a FROM DUAL; a 18446744073709551604 @@ -110,9 +110,9 @@ 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 -1 ^ concat(1,1) AS "a" +Note 1003 select -1 ^ 1 or 1 AS `a` EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL; 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 concat(-1,0) ^ 1 AS "a" +Note 1003 select -1 or 0 ^ 1 AS `a` Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ansi/' ReplayTest: Loading context main.aria_icp_debug [ pass ] 75 main.assign_key_cache_debug [ pass ] 1017 ReplayTest: Loading context main.auto_increment [ pass ] 83 set optimizer_record_context=1; main.b1 [ pass ] main.backup_aria [ pass ] 39 main.bad_frm_crash_5029 [ pass ] 12 main.bad_startup_options [ pass ] 2108 main.bad_startup_options_debug [ pass ] 1558 ReplayTest: Loading context main.bench_count_distinct [ pass ] 25 main.bigint [ pass ] 53 ReplayTest: Loading context ReplayTest: Loading context main.binary [ fail ] Test ended at 2026-04-23 23:24:14 CURRENT_TEST: main.binary --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/binary.result 2026-04-02 14:38:09.279657857 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/binary.reject 2026-04-23 23:24:14.397508458 +0300 @@ -182,6 +182,8 @@ SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF029082020'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref idx idx 20 const 1 Using where; Using index +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(\x1F\x94\x80\x17\x93f\xF2\xBFV~\x1CK\x96L\x1E\xF0)\x08 ) <= (a) <= (\x1F\x94\x80\x17\x93f\xF2\xBFV~\x1CK\x96L\x1E\xF0)\x08 ), ] doesn't exist in the list of ranges for table_name test.t1 and index_name idx SELECT hex(a) from t1 WHERE a=unhex('1F9480179366F2BF567E1C4B964C1EF02908'); hex(a) DROP TABLE t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.binary/' main.binary_to_hex [ pass ] 268 main.blackhole_plugin [ 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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.brackets [ pass ] 297 main.bug12427262 [ pass ] 23 main.bug13633383 [ pass ] 11 main.bulk_replace [ pass ] 10 main.cache_temporal_4265 [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.case [ fail ] Test ended at 2026-04-23 23:24:20 CURRENT_TEST: main.case --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/case.result 2026-04-17 18:40:40.363793990 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/case.reject 2026-04-23 23:24:20.676511160 +0300 @@ -151,10 +151,6 @@ COALESCE(1), COALESCE(1.0),COALESCE('a'), COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'), COALESCE('a' COLLATE latin1_bin,'b'); -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 coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce('a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,'1') AS `COALESCE(1,'1')`,coalesce(1.1,'1') AS `COALESCE(1.1,'1')`,coalesce('a' collate latin1_bin,'b') AS `COALESCE('a' COLLATE latin1_bin,'b')` SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.case/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.cast [ pass ] 125 main.change_user [ pass ] 27 main.change_user_notembedded [ pass ] 5020 main.charset_client_win_utf8mb4 [ skipped ] Need windows main.check [ pass ] 1964 main.check_constraint [ pass ] 54 main.check_constraint_show [ pass ] 8 main.check_view_protocol [ skipped ] Test requires view-protocol main.cli_options_force_protocol_not_win [ pass ] 319 main.client [ pass ] 541 main.client_xml [ pass ] 333 main.column_compression_utf16 [ pass ] 13 main.comment_column [ pass ] 68 main.comment_column2 [ pass ] 50 main.comment_database [ pass ] 1443 main.comment_index [ pass ] 39 main.comment_table [ pass ] 21 main.comments [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.compare [ pass ] 31 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "./include/common-tests.inc": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/compress.test at line 20: ReplayTest: At line 1477 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.compress [ fail ] Test ended at 2026-04-23 23:24:54 CURRENT_TEST: main.compress --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/compress.result 2026-04-02 14:38:09.285657840 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/compress.reject 2026-04-23 23:24:54.471671374 +0300 @@ -634,9 +634,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 @@ -2019,7 +2016,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.compress/' main.connect-no-db [ pass ] 8 main.connect_debug [ pass ] 65 main.constraints [ pass ] 41 main.contributors [ pass ] 2 main.count_distinct [ pass ] 37 ReplayTest: Loading context ReplayTest: Loading context main.create [ fail ] Test ended at 2026-04-23 23:25:07 CURRENT_TEST: main.create --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/create.result 2026-04-02 14:38:09.287657835 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/create.reject 2026-04-23 23:25:06.767541092 +0300 @@ -477,15 +477,8 @@ from t1; explain t2; Field Type Null Key Default Extra -a int(11) YES NULL -b int(11) NO NULL -c int(10) unsigned NO NULL -d date YES NULL -e varchar(1) YES NULL -f datetime YES NULL -g time YES NULL -h blob YES NULL -dd time YES NULL +a int(11) NO 0 +B char(20) YES MUL NULL select * from t2; a b c d e f g h dd 1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.create/' ***Warnings generated in error logs during shutdown after running tests: main.count_distinct main.constraints main.connect_debug main.connect-no-db main.create main.contributors 2026-04-23 23:25:01 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-23 23:25:01 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-23 23:25:01 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-23 23:25:01 30 [ERROR] Invalid (old?) table or database name 't-1' main.create-uca [ pass ] 36 main.create_drop_db [ pass ] 13 main.create_drop_event [ pass ] 1153 main.create_drop_index [ pass ] 15 main.create_drop_procedure [ pass ] 10 main.create_drop_role [ pass ] 40 main.create_drop_server [ pass ] 18 main.create_drop_trigger [ pass ] 23 main.create_drop_udf [ pass ] 10 main.create_drop_user [ pass ] 65 main.create_drop_view [ pass ] 23 main.create_not_windows [ pass ] 19 main.create_or_replace_permission [ pass ] 17 main.create_replace_tmp [ pass ] 8 main.create_user [ pass ] 43 main.create_utf8 [ pass ] 21 main.create_w_max_indexes_128 [ skipped ] Test needs mysqld built with --with-max-indexes=128 main.create_w_max_indexes_64 [ pass ] 36 main.create_windows [ skipped ] Need windows main.cte_cycle [ pass ] 30 main.cte_grant [ pass ] 25 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.cte_nonrecursive [ pass ] 430 main.cte_nonrecursive_not_embedded [ pass ] 16 main.cte_recursive_not_embedded [ 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: Direct EXPLAIN failed on replay server: 1146 Table 'test.tf' doesn't exist ReplayTest: Failed query was: explain with cte as (select f1 as a, f1() as b, 2 as d from tf), cte2 as (select * from t2 where b < 3 group by a) update cte, cte2, t3 set t3.a = cte.a+2 where cte.b = cte2.b and d = t3.a ReplayTest: Loading context 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.cte_update_delete [ fail ] Test ended at 2026-04-23 23:25:28 CURRENT_TEST: main.cte_update_delete --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cte_update_delete.result 2026-04-17 18:40:40.372794546 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cte_update_delete.reject 2026-04-23 23:25:28.361560668 +0300 @@ -597,12 +597,7 @@ explain with cte as (select f1 as a, f1() as b, 2 as d from tf), cte2 as (select * from t2 where b < 3 group by a) update cte, cte2, t3 set t3.a = cte.a+2 where cte.b = cte2.b and d = t3.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 1 -1 PRIMARY ref key0 key0 5 const 1 Using where -1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where -2 DERIVED tf system NULL NULL NULL NULL 1 -3 DERIVED t2 ALL NULL NULL NULL NULL 13 Using where; Using temporary; Using filesort +ReplayTest: Direct EXPLAIN failed on replay server: 1146 Table 'test.tf' doesn't exist with cte as (select f1 as a, f1() as b, 2 as d from tf), cte2 as (select * from t2 where b < 3 group by a) update cte, cte2, t3 set t3.a = cte.a+2 where cte.b = cte2.b and d = t3.a; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.cte_update_delete/' main.ctype_ascii [ pass ] 40 main.ctype_big5 [ pass ] 2527 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_binary [ pass ] 323 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context main.ctype_collate [ fail ] Test ended at 2026-04-23 23:25:35 CURRENT_TEST: main.ctype_collate --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_collate.result 2026-04-02 14:38:09.294657816 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_collate.reject 2026-04-23 23:25:35.317634986 +0300 @@ -605,37 +605,21 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref s2 s2 11 const 1 Using index condition EXPLAIN SELECT * FROM t1 WHERE s1='a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref s1 s1 11 const 1 Using index condition +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2='a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` = "'a' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` >= "'a'" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 IN ('a','b' COLLATE latin1_german1_ci); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 IN ('a','b' COLLATE latin1_german1_ci); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` = "'a'" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 1 Using index condition +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` like "'a' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' DROP TABLE t1; create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1)); insert into t1 set f1=0x3F3F9DC73F; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_collate/' main.ctype_collate_column [ pass ] 2979 main.ctype_collate_context [ pass ] 3067 main.ctype_collate_database [ pass ] 31 main.ctype_collate_implicit [ pass ] 30 main.ctype_collate_implicit_utf32 [ pass ] 15 main.ctype_collate_table [ pass ] 14 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_cp1250_ch [ pass ] 74 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_cp1251 [ pass ] 290 main.ctype_cp850 [ pass ] 53 main.ctype_cp866 [ pass ] 7 main.ctype_cp932 [ pass ] 50 main.ctype_create [ pass ] 23 main.ctype_dec8 [ pass ] 14 main.ctype_errors [ pass ] 28 main.ctype_eucjpms [ pass ] 1915 main.ctype_euckr [ pass ] 1054 main.ctype_filename [ pass ] 25 main.ctype_gb2312 [ pass ] 2515 main.ctype_gbk [ pass ] 2519 main.ctype_gbk_export_import [ skipped ] Need POSIX locale zh_CN.gbk main.ctype_hebrew [ 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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_latin1 [ fail ] Test ended at 2026-04-23 23:26:15 CURRENT_TEST: main.ctype_latin1 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_latin1.result 2026-04-17 18:40:40.375794731 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_latin1.reject 2026-04-23 23:26:15.593614116 +0300 @@ -3657,7 +3657,7 @@ 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\xB3' AS `abcdó`,_utf8mb3'abcd\xC3\xB3' AS `abcd�` +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8mb3'abcd\xC3\xB3' AS `abcdó` # # End of 5.5 tests # @@ -8120,10 +8120,7 @@ a a EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN ('a' COLLATE latin1_bin,'b') AND a='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`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` in (('a' collate latin1_bin),'b') +ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' DROP TABLE t1; # # MDEV-8698 Wrong result for SELECT..WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin; @@ -8140,10 +8137,7 @@ a a EXPLAIN EXTENDED SELECT * FROM t1 WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin AND a='a'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 6 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` between 'a' and ('c' collate latin1_bin) +ReplayTest: Query error: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4' DROP TABLE t1; # # MDEV-8707 Wrong result for SELECT..WHERE varchar_column=DATE'2001-01-01' AND varchar_column='2001-01-01' Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_latin1/' main.ctype_latin1_de [ pass ] 58 main.ctype_latin2 [ pass ] 38 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_latin2_ch [ pass ] 103 main.ctype_like_range [ pass ] 279 main.ctype_many [ pass ] 61 main.ctype_mb [ pass ] 14 main.ctype_nopad_8bit [ pass ] 685 main.ctype_recoding [ pass ] 57 main.ctype_sjis [ pass ] 2486 main.ctype_swe7 [ pass ] 1457 ReplayTest: Loading context ReplayTest: Loading context 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_tis620 [ pass ] 157 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: COLLATION 'utf8mb3_german2_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'utf8mb3_german2_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context 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_uca [ fail ] Test ended at 2026-04-23 23:26:33 CURRENT_TEST: main.ctype_uca --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_uca.result 2026-04-02 14:38:09.315657759 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_uca.reject 2026-04-23 23:26:33.332232235 +0300 @@ -6753,7 +6753,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -6772,13 +6774,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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; @@ -6822,7 +6828,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -6845,7 +6853,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -6874,14 +6884,18 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -6972,7 +6986,9 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -6991,13 +7007,17 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: test.t1.ch doesn't exist in list of range contexts 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; @@ -8383,7 +8403,9 @@ ALTER TABLE t1 ADD KEY(c); EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 43 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 372. SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; hex(c) hex(weight_string(c)) 61 120F @@ -13904,15 +13926,9 @@ a oe EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci; -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` = 'oe' and `test`.`t1`.`a` = 'oe' +ReplayTest: Query error: COLLATION 'utf8mb3_german2_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; -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` = 'oe' and `test`.`t1`.`a` = 'oe' +ReplayTest: Query error: COLLATION 'utf8mb3_german2_ci' is not valid for CHARACTER SET 'utf8mb4' DROP TABLE t1; # # MDEV-17064 LIKE function has error behavior on the fields in which the collation is xxx_unicode_xx Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_uca/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_ucs [ fail ] Test ended at 2026-04-23 23:26:35 CURRENT_TEST: main.ctype_ucs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_ucs.result 2026-04-02 14:38:09.316657757 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_ucs.reject 2026-04-23 23:26:35.181743556 +0300 @@ -251,10 +251,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. select * from t1 where a like "abc%"; a abc @@ -1564,10 +1568,14 @@ INSERT INTO t1 VALUES ('da'),('dz'), (X'0064017E'); EXPLAIN SELECT * FROM t1 WHERE a LIKE 'b%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 383. EXPLAIN SELECT * FROM t1 WHERE a LIKE 'c%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 31 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 382. SELECT * FROM t1 WHERE a LIKE 'c%'; a ca @@ -1576,20 +1584,26 @@ ch EXPLAIN SELECT * FROM t1 WHERE a LIKE 'ch%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 371. SELECT * FROM t1 WHERE a LIKE 'ch%'; a ch ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ucs2 COLLATE ucs2_croatian_ci; EXPLAIN SELECT * FROM t1 WHERE a LIKE 'd%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 31 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 382. SELECT hex(concat('d',_ucs2 0x017E,'%')); hex(concat('d',_ucs2 0x017E,'%')) 0064017E0025 EXPLAIN SELECT * FROM t1 WHERE a LIKE concat('d',_ucs2 0x017E,'%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 385. SELECT hex(a) FROM t1 WHERE a LIKE concat('D',_ucs2 0x017E,'%'); hex(a) 0064017E @@ -6067,10 +6081,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc @@ -6465,10 +6483,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_ucs/' main.ctype_ucs2_uca [ pass ] 221 main.ctype_ujis [ pass ] 1592 main.ctype_ujis_ucs2 [ pass ] 674 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_utf16 [ fail ] Test ended at 2026-04-23 23:26:42 CURRENT_TEST: main.ctype_utf16 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16.result 2026-04-02 14:38:09.320657746 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16.reject 2026-04-23 23:26:42.708650618 +0300 @@ -132,10 +132,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. select * from t1 where a like "abc%"; a abc @@ -2553,10 +2557,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc @@ -2951,10 +2959,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf16/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf16_uca [ fail ] Test ended at 2026-04-23 23:26:44 CURRENT_TEST: main.ctype_utf16_uca --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16_uca.result 2026-04-02 14:38:09.322657740 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16_uca.reject 2026-04-23 23:26:43.925652346 +0300 @@ -4008,7 +4008,9 @@ ALTER TABLE t1 ADD KEY(c); EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 43 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 372. SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; hex(c) hex(weight_string(c)) 0061 120F Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf16_uca/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_utf16le [ fail ] Test ended at 2026-04-23 23:26:45 CURRENT_TEST: main.ctype_utf16le --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16le.result 2026-04-17 18:40:40.377794855 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf16le.reject 2026-04-23 23:26:45.501654596 +0300 @@ -136,10 +136,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. select * from t1 where a like "abc%"; a abc @@ -2739,10 +2743,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc @@ -3137,10 +3145,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf16le/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_utf32 [ fail ] Test ended at 2026-04-23 23:26:47 CURRENT_TEST: main.ctype_utf32 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf32.result 2026-04-17 18:40:40.378794917 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf32.reject 2026-04-23 23:26:47.072656850 +0300 @@ -132,10 +132,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. select * from t1 where a like "abc%"; a abc @@ -2609,10 +2613,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc @@ -3007,10 +3015,14 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. explain select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 43 NULL 2 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: un-escaping error of ranges element at offset 408. select * from t1 where a like "abc%"; a abc Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf32/' main.ctype_utf32_not_embedded [ pass ] 142 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf32_uca [ fail ] Test ended at 2026-04-23 23:26:49 CURRENT_TEST: main.ctype_utf32_uca --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf32_uca.result 2026-04-02 14:38:09.323657738 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf32_uca.reject 2026-04-23 23:26:49.503660364 +0300 @@ -4028,7 +4028,9 @@ ALTER TABLE t1 ADD KEY(c); EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 43 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 372. SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; hex(c) hex(weight_string(c)) 00000061 120F Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf32_uca/' main.ctype_utf8_uca [ pass ] 326 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb3_bin [ pass ] 93 main.ctype_utf8mb3_geeral1400_as_ci [ pass ] 11 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb3_general_ci [ pass ] 90 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb3_uca1400_ai_ci [ pass ] 58 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_bin [ pass ] 55 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_general_ci [ pass ] 49 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_heap [ fail ] Test ended at 2026-04-23 23:26:56 CURRENT_TEST: main.ctype_utf8mb4_heap --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_heap.result 2026-04-02 14:38:09.327657727 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_heap.reject 2026-04-23 23:26:56.402670491 +0300 @@ -1614,7 +1614,9 @@ 1 SIMPLE t1 ALL a NULL NULL NULL 12 Using where 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 +1 SIMPLE t1 ref a a 53 const 2 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 ALL a NULL NULL NULL 12 Using where Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_heap/' 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_myisam [ fail ] Test ended at 2026-04-23 23:26:57 CURRENT_TEST: main.ctype_utf8mb4_myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_myisam.result 2026-04-02 14:38:09.327657727 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_myisam.reject 2026-04-23 23:26:57.527672164 +0300 @@ -1689,10 +1689,14 @@ 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(Käli Käli 2+4) <= (a) <= (Käli Käli 2+4), ] doesn't exist in the list of ranges for table_name test.t1 and index_name a 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 length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_myisam/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_uca [ pass ] 493 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_uca1400_ai_ci [ pass ] 63 main.ctype_utf8mb4_uca_allkeys1400 [ pass ] 10911 main.ctype_utf8mb4_uca_allkeys400 [ pass ] 3825 main.ctype_utf8mb4_uca_allkeys520 [ pass ] 5809 main.custom_aggregate_functions [ pass ] 120 ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f2 does not exist main.custom_aggregates_i_s [ fail ] Test ended at 2026-04-23 23:27:36 CURRENT_TEST: main.custom_aggregates_i_s --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/custom_aggregates_i_s.result 2026-04-17 18:40:40.380795041 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/custom_aggregates_i_s.reject 2026-04-23 23:27:36.269733282 +0300 @@ -37,43 +37,31 @@ subqueries with custom aggregates explain select * from t1, (select f1(sal) as a from t1 where id>= 1) q where q.a=t1.sal; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -1 PRIMARY ref key0 key0 5 test.t1.sal 1 -2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where +ReplayTest: Query error: FUNCTION test.f1 does not exist show status like "%custom_aggregate%"; Variable_name Value Feature_custom_aggregate_functions 2 explain select * from t1, (select sal as a from t1 where (select f1(t3.sal) from t3) >=-1 ) q where q.a=t1.sal; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) -3 SUBQUERY t3 ALL NULL NULL NULL NULL 4 show status like "%custom_aggregate%"; Variable_name Value Feature_custom_aggregate_functions 3 explain select (select f1(sal) as a from t3 where t3.id= t1.id ) from t1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 Using where +ReplayTest: Query error: FUNCTION test.f1 does not exist show status like "%custom_aggregate%"; Variable_name Value Feature_custom_aggregate_functions 4 explain select (select f1(sal) as a from t3 where t3.id= t1.id ) from t1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 Using where +ReplayTest: Query error: FUNCTION test.f1 does not exist show status like "%custom_aggregate%"; Variable_name Value Feature_custom_aggregate_functions 5 custom aggregates inside other custom aggregates explain select f2(sal) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +ReplayTest: Query error: FUNCTION test.f2 does not exist show status like "%custom_aggregate%"; Variable_name Value Feature_custom_aggregate_functions 6 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.custom_aggregates_i_s/' ReplayTest: Loading context main.date_formats [ pass ] 43 main.datetime_456 [ pass ] 9 main.ddl_i18n_koi8r [ pass ] 1140 main.ddl_i18n_utf8 [ pass ] 1114 main.deadlock_ftwrl [ pass ] 19 main.default_debug [ pass ] 10 main.default_session [ pass ] 22 main.default_storage_engine [ pass ] 1401 main.delayed [ pass ] 2346 main.delete_returning_grant [ pass ] 36 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.delete_single_to_multi [ fail ] Test ended at 2026-04-23 23:28:02 CURRENT_TEST: main.delete_single_to_multi --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_single_to_multi.result 2026-04-02 14:38:09.332657713 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_single_to_multi.reject 2026-04-23 23:28:02.368777983 +0300 @@ -373,8 +373,8 @@ 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 26 const 1 Using index condition -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 +1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter 1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where @@ -430,8 +430,8 @@ 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 26 const 1 Using index condition -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 +1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter 1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where @@ -3803,7 +3803,7 @@ "loops": 1, "rows": 17, "cost": "COST_REPLACED", - "filtered": 79.54545593, + "filtered": 82.35294342, "attached_condition": "partsupp_small.ps_partkey is not null", "using_index": true } @@ -3833,10 +3833,10 @@ "key_length": "5", "used_key_parts": ["l_partkey"], "ref": ["dbt3_s001.partsupp_small.ps_partkey"], - "loops": 420.35, + "loops": 420, "rows": 30, "cost": "COST_REPLACED", - "filtered": 0.237896994, + "filtered": 0.238095239, "using_index": true } } @@ -3907,7 +3907,7 @@ "loops": 1, "rows": 17, "cost": "COST_REPLACED", - "filtered": 79.54545593, + "filtered": 82.35294342, "attached_condition": "partsupp_small.ps_partkey is not null", "using_index": true } @@ -3937,10 +3937,10 @@ "key_length": "5", "used_key_parts": ["l_partkey"], "ref": ["dbt3_s001.partsupp_small.ps_partkey"], - "loops": 420.35, + "loops": 420, "rows": 30, "cost": "COST_REPLACED", - "filtered": 0.237896994, + "filtered": 0.238095239, "using_index": true } } @@ -4028,7 +4028,7 @@ "loops": 1, "rows": 17, "cost": "COST_REPLACED", - "filtered": 79.54545593, + "filtered": 82.35294342, "attached_condition": "partsupp_small.ps_partkey is not null", "using_index": true } @@ -4057,10 +4057,10 @@ "key_length": "5", "used_key_parts": ["l_partkey"], "ref": ["dbt3_s001.partsupp_small.ps_partkey"], - "loops": 420.35, + "loops": 420, "rows": 30, "cost": "COST_REPLACED", - "filtered": 0.237896994, + "filtered": 0.238095239, "using_index": true } } Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete_single_to_multi/' main.delimiter_command_case_sensitivity [ pass ] 56 main.deprecated_features [ pass ] 9 main.dirty_close [ pass ] 1050 main.drop_combinations [ pass ] 170 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.dyncol [ pass ] 81 main.empty_server_name-8224 [ pass ] 1320 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.empty_string_literal [ fail ] Test ended at 2026-04-23 23:28:18 CURRENT_TEST: main.empty_string_literal --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/empty_string_literal.result 2026-04-02 14:38:09.342657686 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/empty_string_literal.reject 2026-04-23 23:28:17.897805791 +0300 @@ -163,22 +163,22 @@ 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 NULL AS `NULL` +Note 1003 select '' AS `` EXPLAIN EXTENDED SELECT _latin1''; 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 NULL AS `NULL` +Note 1003 select _latin1'' AS `` EXPLAIN EXTENDED SELECT N''; 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 NULL AS `NULL` +Note 1003 select '' AS `` EXPLAIN EXTENDED SELECT '' ''; 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 NULL AS `NULL` +Note 1003 select '' AS `` # # MDEV-20763 Table corruption or Assertion `btr_validate_index(index, 0, false)' failed in row_upd_sec_index_entry with virtual column and EMPTY_STRING_IS_NULL SQL mode # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.empty_string_literal/' ReplayTest: Loading context ReplayTest: Loading context main.empty_table [ pass ] 65 main.empty_user_table [ pass ] 34 main.engine_error_in_alter-8453 [ pass ] 9 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.except [ pass ] 84 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.except_all [ pass ] 93 main.execution_constants [ pass ] 224 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Invalid utf8mb4 character string: '\xD4\xC1\xC2' ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain.test" ReplayTest: At line 41 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'f1' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain.test" ReplayTest: At line 264 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 ReplayTest: Failed query was: explain replace into t2 select 100, (select a from t1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.explain [ fail ] Test ended at 2026-04-23 23:28:23 CURRENT_TEST: main.explain --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain.result 2026-04-02 14:38:09.343657683 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain.reject 2026-04-23 23:28:23.479815995 +0300 @@ -49,8 +49,6 @@ insert into ��� (���0) values (1); insert into ��� (���0) values (2); explain select ���0 from ��� where ���0=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE ��� ref ���0,���01 ���0 5 const 1 Using index drop table ���; set names latin1; select 3 into @v1; @@ -330,10 +328,6 @@ EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST ("")) WHERE t1.f1 GROUP BY t1.f1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a @@ -409,9 +403,7 @@ create table t2 (b int, c int); replace into t2 select 100, (select a from t1); explain replace into t2 select 100, (select a from t1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t1 system NULL NULL NULL NULL 1 +ReplayTest: Direct EXPLAIN failed on replay server: 1136 Column count doesn't match value count at row 1 drop table t1, t2; # End of 10.1 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.explain/' main.failed_auth_3909 [ pass ] 3029 main.features 'nm' [ pass ] 28 main.filesort_bad_i_s-7585 [ pass ] 84 main.filesort_debug [ pass ] 28 main.filesort_pack [ pass ] 9 main.fix_priv_tables [ pass ] 425 main.flush [ pass ] 4212 main.flush_logs_not_windows [ pass ] 14 main.flush_notembedded [ pass ] 26 main.flush_ssl [ pass ] 2740 main.flush_table [ pass ] 4047 main.frm-debug [ pass ] 36 main.frm_bad_row_type-7333 [ pass ] 5 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.fulltext [ fail ] Test ended at 2026-04-23 23:28:58 CURRENT_TEST: main.fulltext --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/fulltext.result 2026-04-02 14:38:09.347657673 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/fulltext.reject 2026-04-23 23:28:58.140881639 +0300 @@ -764,7 +764,7 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select <'foo'>(('foo',(/* select#2 */ select `test`.`t1`.`f` from `test`.`t1` where (convert('foo' using utf8mb4)) = `test`.`t1`.`f` or `test`.`t1`.`f` is null having `test`.`t1`.`f` is null))) AS `f1`,(match `test`.`t1`.`f` against ('qux' in boolean mode)) AS `f2` from `test`.`t1` +Note 1003 /* select#1 */ select <'foo'>(('foo',(/* select#2 */ select `test`.`t1`.`f` from `test`.`t1` where 'foo' = `test`.`t1`.`f` or `test`.`t1`.`f` is null having `test`.`t1`.`f` is null))) AS `f1`,(match `test`.`t1`.`f` against ('qux' in boolean mode)) AS `f2` from `test`.`t1` drop table t1; # # End of 5.5 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.fulltext/' main.fulltext2 [ pass ] 315 main.fulltext3 [ pass ] 18 main.fulltext_cache [ pass ] 19 main.fulltext_charsets [ pass ] 9 main.fulltext_derived_4257 [ pass ] 10 main.fulltext_derived_4316 [ pass ] 10 main.fulltext_distinct [ pass ] 13 main.fulltext_left_join [ pass ] 20 main.fulltext_multi [ pass ] 10 ReplayTest: Loading context main.fulltext_order_by [ pass ] 23 main.fulltext_update [ pass ] 13 main.fulltext_var [ pass ] 14 main.func_bit [ pass ] 28 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_compress [ pass ] 432 ReplayTest: Loading context main.func_concat [ pass ] 44 ReplayTest: Loading context main.func_crypt [ pass ] 43 main.func_date_add [ pass ] 30 ReplayTest: Loading context main.func_debug [ pass ] 93 ReplayTest: Loading context ReplayTest: Loading context main.func_default [ pass ] 32 main.func_des_encrypt [ pass ] 17 main.func_digest [ pass ] 45 main.func_encrypt_nossl [ skipped ] Test requires: embedded server main.func_encrypt_ucs2 [ pass ] 14 main.func_equal [ pass ] 14 main.func_extract [ pass ] 154 main.func_format [ pass ] 28 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.func_group [ fail ] Test ended at 2026-04-23 23:29:13 CURRENT_TEST: main.func_group --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_group.result 2026-04-17 18:40:40.400796276 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_group.reject 2026-04-23 23:29:13.471911841 +0300 @@ -198,7 +198,7 @@ NULL NULL explain select min(a2) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row explain select max(t1.a1), max(t2.a2) from t1, t2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row @@ -379,112 +379,112 @@ explain select min(a1) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(a1) from t1; min(a1) AME explain select max(a4) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select max(a4) from t1; max(a4) 0.1 explain select min(a5), max(a5) 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(a5), max(a5) from t1; min(a5) max(a5) 1942-02-19 1977-09-23 explain select min(a3) from t1 where a2 = 2; 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(a3) from t1 where a2 = 2; min(a3) CHI explain select min(a1), max(a1) from t1 where a4 = 0.080; 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(a1), max(a1) from t1 where a4 = 0.080; min(a1) max(a1) BDL TWU explain select min(t1.a5), max(t2.a3) from t1, 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(t1.a5), max(t2.a3) from t1, t2; min(t1.a5) max(t2.a3) 1942-02-19 WA explain select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; 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(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; min(t1.a3) max(t2.a2) DEN San Diego explain select min(a1) from t1 where a1 > 'KKK'; 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(a1) from t1 where a1 > 'KKK'; min(a1) PLS explain select min(a1) from t1 where a1 >= 'KKK'; 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(a1) from t1 where a1 >= 'KKK'; min(a1) KKK explain select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; 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 max(a3) from t1 where a2 = 2 and a3 < 'SEA'; max(a3) MIN explain select max(a5) from t1 where a5 < date'1970-01-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 select max(a5) from t1 where a5 < date'1970-01-01'; max(a5) 1969-10-05 explain select max(a3) from t1 where a2 is null; 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 max(a3) from t1 where a2 is null; max(a3) MIN explain select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; 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 max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; max(a3) LAX explain select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; 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(a1), max(a1) from t1 where a1 between 'A' and 'P'; min(a1) max(a1) AME KKK explain select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; 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 max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; max(a3) MIN explain select max(a3) from t1 where a3 = 'MIN' and a2 = 2; 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 max(a3) from t1 where a3 = 'MIN' and a2 = 2; max(a3) MIN @@ -498,7 +498,7 @@ explain select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; 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 max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; max(t1.a3) min(t2.a2) CHI Los Angeles @@ -512,14 +512,14 @@ explain select max(a2) from t1 where a2 >= 1; 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 max(a2) from t1 where a2 >= 1; max(a2) 3 explain select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; 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(a3) from t1 where a2 = 2 and a3 < 'SEA'; min(a3) CHI @@ -540,21 +540,21 @@ explain select (min(a4)+max(a4))/2 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select (min(a4)+max(a4))/2 from t1; (min(a4)+max(a4))/2 0.085 explain select min(a3) from t1 where 2 = a2; 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(a3) from t1 where 2 = a2; min(a3) CHI explain select max(a3) from t1 where a2 = 2 and 'SEA' > a3; 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 max(a3) from t1 where a2 = 2 and 'SEA' > a3; max(a3) MIN @@ -568,21 +568,21 @@ explain select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; 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(a3) from t1 where a2 = 2 and a3 >= 'CHI'; min(a3) CHI explain select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; 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(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; min(a3) CHI explain select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; 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(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; min(a3) MIN @@ -596,7 +596,7 @@ explain select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; 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(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; min(t1.a1) min(t2.a4) AME AME @@ -615,8 +615,7 @@ explain select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'DEN' and t2.a3 >= 'LA'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index -1 SIMPLE t2 range k1 k1 3 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row explain select min(a4 - 0.01) from t1; id select_type table type possible_keys key key_len ref rows Extra @@ -652,8 +651,7 @@ explain select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index -1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 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; create table t1 (a char(10)); insert into t1 values ('a'),('b'),('c'); @@ -1327,7 +1325,7 @@ INSERT INTO t1 VALUES (NULL, 1), (NULL, 2); EXPLAIN SELECT MIN(a), MIN(b) FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT MIN(a), MIN(b) FROM t1; MIN(a) MIN(b) NULL 1 @@ -1336,7 +1334,7 @@ ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 ), ( 2, NULL, 2 ), ( 2, 3, 4 ), ( 2, 4, 4 ); EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref a a 5 const 3 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; MIN(b) MIN(c) 3 2 @@ -1344,7 +1342,7 @@ INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2; 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(a), MIN(b) FROM t3 where a = 2; MIN(a) MIN(b) 2 NULL @@ -1352,7 +1350,7 @@ INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3); EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2; 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(a), MIN(b) FROM t4 where a = 2; MIN(a) MIN(b) 2 NULL @@ -1363,7 +1361,7 @@ INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 ); EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; 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(a), MIN(b) FROM t5 WHERE a = 1; MIN(a) MIN(b) 1 1 @@ -1514,7 +1512,7 @@ FROM t1 ORDER BY max; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row # Only 11 is correct for column i in this result SELECT MAX(pk) as max, i @@ -1851,10 +1849,9 @@ EXPLAIN EXTENDED SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch -1 PRIMARY t1 range a a 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = 1 and `test`.`t2`.`b` = 2 and `test`.`t1`.`a` < 10 +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from (`test`.`t2`) join `test`.`t1` where `test`.`t1`.`a` < 10 and multiple equal(1, `test`.`t2`.`a`) and multiple equal(2, `test`.`t2`.`b`) SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; MAX(a) NULL @@ -1985,8 +1982,8 @@ SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'j' Warning 1292 Truncated incorrect DOUBLE value: 'j' @@ -2013,8 +2010,8 @@ SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No matching min/max row -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where # # 3) Test that subquery materialization is setup for query with @@ -2037,8 +2034,8 @@ SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where # # 4) Test that subquery materialization is setup for query with @@ -2062,8 +2059,8 @@ SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table set optimizer_switch=@tmp_optimizer_switch; @@ -2089,8 +2086,8 @@ SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using where; Using index -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set @@optimizer_switch=@save_optimizer_switch; # @@ -2215,14 +2212,14 @@ # The following should produce "Select tables optimized away" EXPLAIN SELECT MIN(b) FROM t1 WHERE b <= '2013-11-06 23:59:59'; 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 connect con1,localhost,root,,; connection con1; set names utf8; # Should be the same as above: EXPLAIN SELECT MIN(b) FROM t1 WHERE b <= '2013-11-06 23:59:59'; 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 connection default; disconnect con1; DROP TABLE t1; @@ -2240,7 +2237,7 @@ # should show "Select tables optimized away" explain select MIN(b) from t1 where b >= inet_aton('192.168.119.32'); 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 DROP TABLE t1; # # MDEV-6743 crash in GROUP_CONCAT(IF () ORDER BY 1) @@ -2475,13 +2472,13 @@ 287 explain select max(a) from t1 where a < 303 and (a between 267 AND 287); 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(a) from t1 where a > 267 and (a between 273 AND 303); min(a) 273 explain select min(a) from t1 where a > 267 and (a between 273 AND 303); 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 drop table t1; # # End of 10.2 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_group/' main.func_hybrid_type [ pass ] 231 ReplayTest: Loading context ReplayTest: Loading context main.func_if [ pass ] 44 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 832 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 847 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 854 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 857 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 860 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 865 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 866 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 869 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 870 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 896 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 899 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 902 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 905 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 911 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query error: Server has gone away ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.test" ReplayTest: At line 912 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.func_in [ fail ] Test ended at 2026-04-23 23:29:22 CURRENT_TEST: main.func_in --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.result 2026-04-02 14:38:09.353657656 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_in.reject 2026-04-23 23:29:22.282929499 +0300 @@ -1106,10 +1106,7 @@ 3 EXPLAIN SELECT * FROM t1 WHERE a IN ((SELECT MAX(a) FROM t1), (SELECT MAX(a) FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using index -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +ReplayTest: Query error: Lost connection to server during query # There must be no conversion here: SELECT * FROM t1 WHERE a IN (3,2,3,3,1,2,3); a @@ -1130,8 +1127,6 @@ a 2 EXPLAIN SELECT * FROM t1 WHERE a IN ((SELECT 2), (SELECT 2)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index CREATE TABLE t2 (a INT, b VARCHAR(10), PRIMARY KEY(a,b)) CHARSET=latin1; INSERT INTO t2 VALUES (1,'abc'),(2,'def'),(3,'ghi'); SELECT * FROM t2 WHERE (a,b) IN ((1,'abc'),(1,'abc')); @@ -1139,22 +1134,16 @@ 1 abc # 'const' access due to conversion to equality EXPLAIN SELECT * FROM t2 WHERE (a,b) IN ((1,'abc'),(1,'abc')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 const PRIMARY PRIMARY 16 const,const 1 Using index SELECT * FROM t2 WHERE (a,b) IN ((2,'def'),(2,'def'),(2,'XYZ')); a b 2 def # No conversion due to different values EXPLAIN SELECT * FROM t2 WHERE (a,b) IN ((2,'def'),(2,'def'),(2,'XYZ')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY PRIMARY 16 NULL 2 Using where; Using index SELECT * FROM t2 WHERE (a,b) IN ((2,'def'),(2,'def'),(2,NULL)); a b 2 def # No conversion due to NULL EXPLAIN SELECT * FROM t2 WHERE (a,b) IN ((2,'def'),(2,'def'),(2,NULL)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY PRIMARY 16 NULL 1 Using where; Using index SELECT * FROM t2 WHERE (a,b) NOT IN ((2,'def'),(2,'def'),(2,NULL)); a b 1 abc @@ -1163,21 +1152,13 @@ a b 1 abc EXPLAIN SELECT * FROM t2 WHERE a IN (1,1,1,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index EXPLAIN SELECT * FROM t2 WHERE a = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index SELECT * FROM t2 WHERE b NOT IN ('abc','abc'); a b 2 def 3 ghi EXPLAIN SELECT * FROM t2 WHERE b NOT IN ('abc','abc'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL PRIMARY 16 NULL 3 Using where; Using index EXPLAIN SELECT * FROM t2 WHERE b != 'abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL PRIMARY 16 NULL 3 Using where; Using index # Prepared statements PREPARE stmt FROM "EXPLAIN SELECT * FROM t2 WHERE (a,b) IN ((1,'abc'),(1,'abc'))"; EXECUTE stmt; @@ -1210,46 +1191,20 @@ # Conversion to equalities EXPLAIN SELECT * FROM (t1,t2) LEFT JOIN (t3,t4) ON t1.a IN (2,2,2) AND t3.a IN (1,1,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1 Using where; Using index -1 SIMPLE t4 ALL NULL NULL NULL NULL 2 # No conversion to equalities due to different values in IN() EXPLAIN SELECT * FROM (t1,t2) LEFT JOIN (t3,t4) ON t1.a IN (2,3) AND t3.a IN (1,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (incremental, BNL join) -1 SIMPLE t4 ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join) # Conversion to equalities EXPLAIN SELECT * FROM t1 LEFT JOIN ((t2, t3) LEFT JOIN t4 ON t2.a = t4.a) ON t1.a = t2.a WHERE t1.a IN (2,2,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t4 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t3 index NULL PRIMARY 4 NULL 4 Using index # No conversion to equalities due to different values in IN() EXPLAIN SELECT * FROM t1 LEFT JOIN ((t2, t3) LEFT JOIN t4 ON t2.a = t4.a) ON t1.a = t2.a WHERE t1.a IN (1,3); -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 -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 -1 SIMPLE t4 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t3 index NULL PRIMARY 4 NULL 4 Using index # View CREATE VIEW v1 AS SELECT t1.*, t2.b AS t2_b FROM t1 LEFT JOIN t2 ON t1.a = t2.a; EXPLAIN SELECT * FROM v1 WHERE a IN (2,2,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 EXPLAIN SELECT * FROM v1 WHERE a IN (1,2,3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using index condition -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 # Stored procedures CREATE PROCEDURE p1(pa INT, pb INT) EXPLAIN SELECT * FROM t1 WHERE a IN (pa, pb); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_in/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.func_int' mysql-test-run: restarting replay server... Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 207240 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: 19071 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 mysql-test-run: replay server restarted (pid 207240) main.func_int [ pass ] 13 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Field 'pk' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_isnull.test" ReplayTest: At line 97 ReplayTest: Loading context main.func_isnull [ fail ] Test ended at 2026-04-23 23:29:33 CURRENT_TEST: main.func_isnull --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_isnull.result 2026-04-02 14:38:09.353657656 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_isnull.reject 2026-04-23 23:29:33.022951304 +0300 @@ -114,10 +114,6 @@ CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES (1); EXPLAIN EXTENDED SELECT ISNULL(pk) FROM v1; -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 -Warnings: -Note 1003 select /*always not null*/ 1 is null AS `ISNULL(pk)` from dual EXPLAIN EXTENDED SELECT IFNULL(pk,0) FROM v1; 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 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_isnull/' main.func_json_notembedded [ pass ] 71 main.func_kdf 'new' [ pass ] 35 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_like [ fail ] Test ended at 2026-04-23 23:29:34 CURRENT_TEST: main.func_like --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_like.result 2026-04-02 14:38:09.355657651 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_like.reject 2026-04-23 23:29:34.476954280 +0300 @@ -3,14 +3,16 @@ insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); explain extended select * from t1 where a like 'abc%'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 13 NULL 2 100.00 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like 'abc%' +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. +Note 1003 select NULL AS `a` from `test`.`t1` where 0 explain extended select * from t1 where a like concat('abc','%'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 13 NULL 2 100.00 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like (concat('abc','%')) +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 369. +Note 1003 select NULL AS `a` from `test`.`t1` where 0 select * from t1 where a like "abc%"; a abc Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_like/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.func_math [ pass ] 380 main.func_numconv [ pass ] 54 main.func_numconv_debug [ pass ] 15 main.func_numconv_format [ pass ] 10301 main.func_numconv_ucs2 [ pass ] 16 ReplayTest: Loading context ReplayTest: Loading context main.func_op [ pass ] 11 ReplayTest: Loading context main.func_regexp [ pass ] 29 ReplayTest: Loading context ReplayTest: Loading context main.func_regexp_pcre [ pass ] 33 main.func_regexp_pcre_debug [ pass ] 7 main.func_replace [ pass ] 19 main.func_sapdb [ pass ] 20 ReplayTest: Loading context main.func_set [ pass ] 21 main.func_sformat [ pass ] 39 ReplayTest: Loading context main.func_system [ pass ] 13 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.func_test [ pass ] 54 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_time [ pass ] 8235 main.func_time_32 [ skipped ] Need a 32 bit timestamps main.func_time_64 [ pass ] 18 ReplayTest: Loading context main.func_time_hires [ pass ] 29 main.func_time_round [ pass ] 41 main.func_timestamp [ pass ] 9 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_weight_string [ pass ] 44 main.function_defaults [ pass ] 262 main.function_defaults_notembedded [ pass ] 65 main.gcc296 [ pass ] 13 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: 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 '\0\0\0\0\0001\0001\0\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0@)' at line 1 ReplayTest: In included file "./include/gis_keys.inc": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis.test at line 677: ReplayTest: At line 22 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.gis [ fail ] Test ended at 2026-04-23 23:30:19 CURRENT_TEST: main.gis --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis.result 2026-04-17 18:40:40.413797079 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis.reject 2026-04-23 23:30:18.854047566 +0300 @@ -963,8 +963,6 @@ 1 EXPLAIN SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 system p NULL NULL NULL 1 SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)'); COUNT(*) 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.gis/' main.gis-debug [ pass ] 82 main.gis-json [ pass ] 16 main.gis-loaddata [ pass ] 11 main.gis-precise [ pass ] 6761 ReplayTest: Loading context ReplayTest: Loading context main.gis-rt-precise [ pass ] 42 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.gis-rtree [ pass ] 207 main.gis_notembedded [ pass ] 27 main.grant5 [ pass ] 99 main.grant_4332 [ pass ] 53 main.grant_binlog_replay [ pass ] 14 main.grant_cache_no_prot [ pass ] 86 main.grant_cache_ps_prot [ skipped ] Need ps-protocol ReplayTest: Loading context ReplayTest: Direct EXPLAIN failed on replay server: 4078 Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`a` ReplayTest: Failed query was: EXPLAIN INSERT INTO t1 VALUES (10) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.grant_explain_non_select [ fail ] Test ended at 2026-04-23 23:30:41 CURRENT_TEST: main.grant_explain_non_select --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/grant_explain_non_select.result 2026-04-02 14:38:09.367657618 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/grant_explain_non_select.reject 2026-04-23 23:30:41.331096503 +0300 @@ -21,8 +21,7 @@ GRANT INSERT ON privtest_db.t1 TO 'privtest'@'localhost'; connection con1; EXPLAIN INSERT INTO t1 VALUES (10); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +ReplayTest: Direct EXPLAIN failed on replay server: 4078 Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`a` INSERT INTO t1 VALUES (10); EXPLAIN INSERT INTO t1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra @@ -71,7 +70,7 @@ REPLACE INTO t1 VALUES (10); EXPLAIN REPLACE INTO t1 SELECT * FROM t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found REPLACE INTO t1 SELECT * FROM t2; connection default; REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost'; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.grant_explain_non_select/' main.grant_kill [ pass ] 30 main.grant_lowercase_fs [ skipped ] Test requires: 'case_insensitive_fs' main.grant_master_admin [ pass ] 12 main.grant_plugin [ pass ] 18 main.grant_read_only [ pass ] 18 main.grant_repair [ pass ] 59 main.grant_server [ pass ] 24 main.grant_slave_admin [ pass ] 14 main.grant_slave_monitor [ pass ] 16 main.grant_utf8_cli [ pass ] 48 main.group_by_null [ pass ] 2 main.handler_read_last [ 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: Query error: FUNCTION test.next_seq_value does not exist ReplayTest: Loading context ReplayTest: Loading context main.having [ fail ] Test ended at 2026-04-23 23:30:50 CURRENT_TEST: main.having --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/having.result 2026-04-17 18:40:40.422797636 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/having.reject 2026-04-23 23:30:50.067115798 +0300 @@ -622,11 +622,10 @@ WHERE t2.f2 IN ( SELECT f3 FROM t3 ) HAVING field1 < 's'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 100.00 -1 PRIMARY t1 index NULL f10 4 NULL 2 100.00 Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row 2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 /* select#1 */ select min(`test`.`t1`.`f10`) AS `field1` from `test`.`t1` where <7>((7,(/* select#2 */ select `test`.`t3`.`f3` from `test`.`t3` where (7) = `test`.`t3`.`f3`))) having `field1` < 's' +Note 1003 /* select#1 */ select min(`test`.`t1`.`f10`) AS `field1` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`f2`,(/* select#2 */ select `test`.`t3`.`f3` from `test`.`t3` where (`test`.`t2`.`f2`) = `test`.`t3`.`f3`)) having `field1` < 's' set optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; End of 5.2 tests @@ -833,8 +832,7 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK explain SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) GROUP BY t HAVING r = 1 ORDER BY t1.u; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL t 5 NULL 8 Using temporary; Using filesort +ReplayTest: Query error: FUNCTION test.next_seq_value does not exist SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) GROUP BY t HAVING r = 1 ORDER BY t1.u; t r 10 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.having/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.having_cond_pushdown [ fail ] Test ended at 2026-04-23 23:30:51 CURRENT_TEST: main.having_cond_pushdown --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/having_cond_pushdown.result 2026-04-17 18:40:40.423797697 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/having_cond_pushdown.reject 2026-04-23 23:30:51.546119080 +0300 @@ -939,38 +939,12 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (a=test.f1()); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort +ReplayTest: Query error: FUNCTION test.f1 does not exist explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (a=test.f1()); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a = test.f1()", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1" - } - } - ] - } - } - } -} +ReplayTest: Query error: FUNCTION test.f1 does not exist set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a>1) @@ -5946,20 +5920,9 @@ { "query_block": { "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = (subquery#2)" - } - } - ], + "table": { + "message": "Impossible WHERE" + }, "subqueries": [ { "query_block": { @@ -6051,45 +6014,29 @@ { "query_block": { "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.b, t1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = (subquery#2) and (t1.b = (subquery#2) or t1.c = (subquery#2))" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] + "table": { + "message": "Impossible WHERE" + }, + "subqueries": [ + { + "query_block": { + "select_id": 2, + "cost": "COST_REPLACED", + "nested_loop": [ + { + "table": { + "table_name": "t1", + "access_type": "ALL", + "loops": 1, + "rows": 2, + "cost": "COST_REPLACED", + "filtered": 100 + } } - } - ] + ] + } } - } + ] } } SELECT a,b,c FROM t1 GROUP BY a,b,c @@ -6102,45 +6049,29 @@ { "query_block": { "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = (subquery#2) and (1 or (subquery#2) > t1.b)" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] + "table": { + "message": "Impossible WHERE" + }, + "subqueries": [ + { + "query_block": { + "select_id": 2, + "cost": "COST_REPLACED", + "nested_loop": [ + { + "table": { + "table_name": "t1", + "access_type": "ALL", + "loops": 1, + "rows": 2, + "cost": "COST_REPLACED", + "filtered": 100 + } } - } - ] + ] + } } - } + ] } } SELECT a FROM t1 GROUP BY a,b Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.having_cond_pushdown/' main.help [ pass ] 112 main.identifier [ pass ] 43 main.implicit_char_to_num_conversion [ pass ] 26 main.in_datetime_241 [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.in_subq_cond_pushdown [ pass ] 484 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.index_intersect [ fail ] Test ended at 2026-04-23 23:30:58 CURRENT_TEST: main.index_intersect --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_intersect.result 2026-04-17 18:40:40.423797697 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/index_intersect.reject 2026-04-23 23:30:57.908133242 +0300 @@ -65,22 +65,30 @@ SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1249. SELECT * FROM City USE INDEX () WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -362,17 +370,23 @@ SELECT * FROM City WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1240. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1240. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,Country Name,Country # NULL # Using sort_intersect(Name,Country); Using where +1 SIMPLE NULL NULL NULL NULL # NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1237. SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -463,17 +477,23 @@ SELECT * FROM City WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1803. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1800. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country Country 3 NULL # Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1805. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000 @@ -697,27 +717,37 @@ SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 1500000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1250. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1240. EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1237. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1800. EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 @@ -852,7 +882,9 @@ SELECT * FROM City WHERE Country LIKE 'M%' AND Population > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,CountryID,CountryName Population,CountryID 4,3 NULL # Using sort_intersect(Population,CountryID); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1356. EXPLAIN SELECT * FROM City WHERE Country='USA' AND Population > 1000000; @@ -862,7 +894,9 @@ SELECT * FROM City WHERE Country='USA' AND Population > 1500000 AND Name LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,CountryID,CountryName CountryName,Population 38,4 NULL # Using sort_intersect(CountryName,Population); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1364. SELECT * FROM City USE INDEX () WHERE Country LIKE 'M%' AND Population > 1000000; ID Name Country Population @@ -934,8 +968,10 @@ WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND Country.Code=City.Country; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,CountryID,CountryName Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country # +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 2154. +Warning 4254 Failed to match the stats from replay context with the optimizer stats: world.City doesn't exist in list of table contexts DROP DATABASE world; use test; CREATE TABLE t1 ( @@ -963,7 +999,9 @@ SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,f4 f4,PRIMARY 35,4 NULL # Using sort_intersect(f4,PRIMARY); Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1040. SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; f1 f4 f5 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.index_intersect/' main.information_schema2 [ pass ] 37 main.information_schema_chmod [ pass ] 9 main.information_schema_columns [ pass ] 12 main.information_schema_linux [ pass ] 9 main.information_schema_parameters [ pass ] 56 main.information_schema_prepare [ pass ] 9 main.information_schema_routines [ pass ] 56 main.information_schema_stats [ pass ] 34 main.init_file_set_password-7656 [ pass ] 1330 main.insert [ pass ] 843 main.insert_notembedded [ pass ] 65 main.insert_returning_datatypes [ pass ] 11 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.insert_select [ pass ] 277 ReplayTest: Loading context ReplayTest: Loading context main.insert_update [ pass ] 2060 main.insert_update_autoinc-7150 [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.intersect [ pass ] 2431 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: 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 '"i3" ( "x" int(11) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect_all.test" ReplayTest: At line 340 ReplayTest: Loading context ReplayTest: Query error: 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 '"t2" ( "a" int(11) DEFAULT NULL, "b" int(11) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect_all.test" ReplayTest: At line 419 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: 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 '"t2" ( "a" int(11) DEFAULT NULL, "b" int(11) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect_all.test" ReplayTest: At line 473 main.intersect_all [ fail ] Test ended at 2026-04-23 23:31:26 CURRENT_TEST: main.intersect_all --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect_all.result 2026-04-02 14:38:09.381657581 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect_all.reject 2026-04-23 23:31:25.965196551 +0300 @@ -1093,14 +1093,6 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL set sql_mode= 'oracle'; explain SELECT * from t3 union select * from u3 intersect all select * from i3; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -4 DERIVED ALL NULL NULL NULL NULL 2 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL UNION RESULT ALL NULL NULL NULL NULL NULL -5 INTERSECT NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL select x from t3 union select x from u3 intersect select x from i3; x SELECT x from t3 union select x from u3 intersect all select x from i3; @@ -1223,14 +1215,6 @@ 1 2 2 3 explain select * from t1 intersect all select * from t2 union values (1, 2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 8 -4 DERIVED ALL NULL NULL NULL NULL 7 -2 DERIVED t1 ALL NULL NULL NULL NULL 7 -3 INTERSECT t2 ALL NULL NULL NULL NULL 7 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -5 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL show create view v1; View Create View character_set_client collation_connection v1 CREATE VIEW "v1" AS select "__6"."a" AS "a","__6"."b" AS "b" from (select "__4"."a" AS "a","__4"."b" AS "b" from (select "t1"."a" AS "a","t1"."b" AS "b" from "t1" intersect all select "t2"."a" AS "a","t2"."b" AS "b" from "t2") "__4" union values (1,2)) "__6" latin1 latin1_swedish_ci @@ -1332,14 +1316,6 @@ 1 2 drop view v2; EXPLAIN select * from t1 except all select * from t2 intersect all values (1, 2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -4 DERIVED ALL NULL NULL NULL NULL 4 -2 DERIVED t1 ALL NULL NULL NULL NULL 4 -3 EXCEPT t2 ALL NULL NULL NULL NULL 2 -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL -5 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL select * from t2 union all select * from t2; a b 1 2 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.intersect_all/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.invisible_field [ pass ] 137 ReplayTest: Loading context ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' ReplayTest: Loading context ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' ReplayTest: Loading context ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' main.invisible_field_debug [ fail ] Test ended at 2026-04-23 23:31:30 CURRENT_TEST: main.invisible_field_debug --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/invisible_field_debug.result 2026-04-02 14:38:09.381657581 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/invisible_field_debug.reject 2026-04-23 23:31:30.507206928 +0300 @@ -345,8 +345,7 @@ 9 6 6 9 7 7 explain select * from t1 where invisible =9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref invisible invisible 5 const 7 +ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' alter table t1 add x int default 3; select invisible, a ,b from t1; invisible a b @@ -367,12 +366,10 @@ drop index invisible on t1; ERROR 42000: Can't DROP INDEX `invisible`; check that it exists explain select * from t1 where invisible =9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref invisible invisible 5 const 7 +ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' create index invisible on t1(c); explain select * from t1 where invisible =9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref invisible_2 invisible_2 5 const 7 +ReplayTest: Query error: Unknown column 'invisible' in 'WHERE' show indexes in t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored t1 1 b 1 b A NULL NULL NULL YES BTREE NO Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.invisible_field_debug/' main.invisible_field_grant_completely [ pass ] 34 main.invisible_field_grant_system [ pass ] 15 main.item_types [ pass ] 25 main.join_crash [ pass ] 23 main.json_debug_nonembedded [ pass ] 11 main.json_equals [ pass ] 28 main.json_normalize [ pass ] 26 ReplayTest: Loading context main.key_diff [ pass ] 15 main.key_primary [ pass ] 13 main.keywords [ pass ] 103 main.kill_processlist-6619 [ pass ] 13 main.kill_query-6728 [ pass ] 9 main.last_value [ pass ] 9 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.limit [ pass ] 37 main.loaddata [ pass ] 126 main.loadxml [ pass ] 3270 main.lock_multi [ pass ] 7261 main.lock_multi_bug38499 [ pass ] 1536 main.lock_multi_bug38691 [ pass ] 818 main.lock_user [ pass ] 1049 main.lock_view [ pass ] 126 main.log_crash [ pass ] 1437 main.log_errchk [ pass ] 1364 main.log_slow [ pass ] 1589 main.log_slow_always_query_time [ pass ] 3021 main.log_tables_debug [ pass ] 17 main.long_host [ pass ] 70 main.long_unique_bugs_no_sp_protocol [ pass ] 25 main.long_unique_debug [ pass ] 22 main.long_unique_delayed [ pass ] 13 main.long_unique_update [ pass ] 58 main.long_unique_using_hash [ pass ] 12 main.lotofstack [ pass ] 225 main.lowercase_fs_off [ pass ] 1071 main.lowercase_fs_on [ skipped ] Test requires: 'case_insensitive_file_system' main.lowercase_table5 [ pass ] 64 main.max_password_errors [ pass ] 3049 main.mdev-34724 [ pass ] 111 main.mdev19198 [ pass ] 11 main.mdev316 [ pass ] 9 main.mdev375 [ pass ] 17 main.mdev6830 [ pass ] 22 main.mdev_14586 [ pass ] 26 main.mdev_19276 [ pass ] 29 main.mdev_22370 [ pass ] 2427 main.memory_used [ pass ] 12 main.metadata [ pass ] 62 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.mix2_myisam [ fail ] Test ended at 2026-04-23 23:32:54 CURRENT_TEST: main.mix2_myisam --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/mix2_myisam.result 2026-04-02 14:38:09.397657537 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/mix2_myisam.reject 2026-04-23 23:32:53.828536052 +0300 @@ -1542,7 +1542,9 @@ 1 SIMPLE t1 ref t t 13 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 533. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 13 const # Using where; Using index @@ -1738,7 +1740,9 @@ 1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # Using where; Using index @@ -1818,7 +1822,9 @@ 1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.mix2_myisam/' main.mix2_myisam_ucs2 [ pass ] 74 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.mrr_icp_extra [ fail ] Test ended at 2026-04-23 23:32:58 CURRENT_TEST: main.mrr_icp_extra --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/mrr_icp_extra.result 2026-04-02 14:38:09.397657537 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/mrr_icp_extra.reject 2026-04-23 23:32:58.764477806 +0300 @@ -26,37 +26,21 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref s2 s2 11 const 1 Using index condition EXPLAIN SELECT * FROM t1 WHERE s1='a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref s1 s1 11 const 1 Using index condition +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2='a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` = "'a' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition; Rowid-ordered scan +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` >= "'a'" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 IN ('a','b' COLLATE latin1_german1_ci); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition; Rowid-ordered scan +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 IN ('a','b' COLLATE latin1_german1_ci); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` = "'a'" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range s1 s1 11 NULL 1 Using index condition; Rowid-ordered scan +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where -Warnings: -Note 1105 Cannot use key `s2` part[0] for lookup: `test`.`t1`.`s2` of collation `latin1_swedish_ci` like "'a' collate latin1_german1_ci" of collation `latin1_german1_ci` +ReplayTest: Query error: COLLATION 'latin1_german1_ci' is not valid for CHARACTER SET 'utf8mb4' DROP TABLE t1; # # @@ -212,7 +196,9 @@ SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,f4 f4 35 NULL 5 Using index condition; Using where; Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1040. SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; f1 f4 f5 @@ -351,7 +337,9 @@ 1 SIMPLE t1 ref t t 13 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 533. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 13 const # Using where; Using index @@ -547,7 +535,9 @@ 1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # Using where; Using index @@ -627,7 +617,9 @@ 1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 549. explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where @@ -871,7 +863,9 @@ SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country # # NULL # Using index condition; Using where; Rowid-ordered scan +1 SIMPLE NULL NULL NULL # # NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1153. SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; ID Name Country Population @@ -891,7 +885,9 @@ SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country # # NULL # Using index condition; Using where; Rowid-ordered scan +1 SIMPLE NULL NULL NULL # # NULL # Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 1153. SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; ID Name Country Population Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.mrr_icp_extra/' main.multi_update_debug [ pass ] 42 main.my_print_defaults [ pass ] 47 main.myisam-system [ pass ] 11 main.myisam_debug [ pass ] 141 main.myisam_debug_keys [ pass ] 380 main.myisam_enable_keys-10506 [ pass ] 20 ReplayTest: Loading context main.myisam_icp_debug [ pass ] 28 main.myisam_icp_notembedded [ pass ] 91 ReplayTest: Loading context main.myisam_optimize [ pass ] 115 main.myisampack [ pass ] 593 main.mysql [ pass ] 106207 main.mysql-bug41486 [ pass ] 178 main.mysql-bug45236 [ pass ] 134 main.mysql-interactive [ pass ] 114 main.mysql-metadata [ pass ] 102 main.mysql5613mysql [ pass ] 43 main.mysql57_virtual [ pass ] 14 main.mysql_comments [ pass ] 115 main.mysql_connector_net [ skipped ] Need windows main.mysql_cp932 [ pass ] 218 main.mysql_install_db_win [ skipped ] Need windows main.mysql_install_db_win_utf8 [ skipped ] Need windows main.mysql_locale_posix [ skipped ] Need POSIX locale de_DE.iso88591 main.mysql_not_windows [ pass ] 265 main.mysql_protocols [ pass ] 165 main.mysql_upgrade_file_leak [ pass ] 71 main.mysql_upgrade_mysql_json [ pass ] 3440 main.mysql_upgrade_mysql_json_system_tables [ pass ] 777 main.mysql_upgrade_no_innodb [ pass ] 736 main.mysqladmin [ pass ] 4209 main.mysqld--defaults-file [ pass ] 232 main.mysqld--help 'unix' [ pass ] 114 main.mysqld--help-aria [ pass ] 241 main.mysqld_help_crash-9183 [ pass ] 96 worker[01] Trying to dump core for [mysqltest - pid: 209715, winpid: 209715] worker[01] Trying to dump core for [mysqld.1 - pid: 209628, winpid: 209628] main.mysqld_option_err [ fail ] timeout after 900 seconds Test ended at 2026-04-23 23:52:50 Test case timeout after 900 seconds == /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/mysqld_option_err.log == Test that unknown option is not silently ignored. Test bad binlog format. Test bad default storage engine. Test non-numeric value passed to number option. Test that bad value for plugin enum option is rejected correctly. == /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/analyze-timeout-mysqld.1.err == mysqltest: Could not open connection 'default' after 500 attempts: 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) mysqltest failed but provided no output The result from queries just before the failure was: < snip > Test that unknown option is not silently ignored. Test bad binlog format. Test bad default storage engine. Test non-numeric value passed to number option. Test that bad value for plugin enum option is rejected correctly. - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.mysqld_option_err/' ***Warnings generated in error logs during shutdown after running tests: main.mysqladmin main.mysqld--help main.mysqld_help_crash-9183 main.mysqld_option_err main.mysqld--help-aria main.mysqld--defaults-file 260423 23:51:42 [ERROR] /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd got signal 6 ; Attempting backtrace. Include this in the bug report. main.mysqldump-header [ pass ] 728 main.mysqldump-nl [ pass ] 191 main.mysqldump-timing [ pass ] 1207 main.mysqldump-utf8mb4 [ pass ] 187 main.mysqlhotcopy_myisam [ skipped ] Test needs Perl modules DBI and DBD::MariaDB main.mysqlshow [ pass ] 224 main.mysqltest-break [ pass ] 17 main.mysqltest_256 [ pass ] 7 main.mysqltest_cont_on_error [ pass ] 27 main.mysqltest_ps [ skipped ] Need ps-protocol main.mysqltest_tracking_info [ pass ] 17 main.mysqltest_tracking_info_debug [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.name_const_replacement [ pass ] 27 main.name_resolution_cache_debug [ pass ] 17 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.negation_elimination [ pass ] 112 main.nested_profiling [ pass ] 14 main.no_binlog [ pass ] 7 main.non_blocking_api [ pass ] 9 main.not_embedded_server [ pass ] 60 main.not_partition [ skipped ] Test requires no partitioning ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.null [ pass ] 149 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.null_key [ fail ] Test ended at 2026-04-23 23:55:10 CURRENT_TEST: main.null_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/null_key.result 2026-04-02 14:38:09.418657480 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/null_key.reject 2026-04-23 23:55:10.734706711 +0300 @@ -80,24 +80,44 @@ explain select * from t1 where a is null and b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 3 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` explain select * from t1 where a is null and b = 2 and c=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 3 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` explain select * from t1 where a is null and b = 7 and c=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 3 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` explain select * from t1 where a=2 and b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 1 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "2" of type `int` explain select * from t1 where a<=>b limit 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a,b a 5 NULL 5 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` < "5" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` < "5" of type `int` +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` < "5" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` < "5" of type `int` explain select * from t1 where (a is null or a = 7) and b=7 and c=0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a,b a 5 const 3 Using where @@ -110,12 +130,17 @@ explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a,b a 5 NULL 4 Using where +Warnings: +Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` +Note 1105 Cannot use key `b` part[0] for lookup: `test`.`t1`.`b` of type `blob` = "7" of type `int` explain select * from t1 where a > 8 and a < 9; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 5 NULL 1 Using where explain select * from t1 where b like "6%"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range b b 12 NULL 1 Using where +Warnings: +Warning 4254 Failed to match the stats from replay context with the optimizer stats: the given list of ranges i.e. [(6) <= (b) <= (6\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF), ] doesn't exist in the list of ranges for table_name test.t1 and index_name b select * from t1 where a is null; a b c NULL 7 0 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.null_key/' ReplayTest: Loading context main.odbc [ pass ] 31 ReplayTest: Loading context ReplayTest: Loading context main.olap [ pass ] 91 main.openssl_1 [ pass ] 597 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hint_rowid_filter [ pass ] 215 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_index [ pass ] 420 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_join_cache [ pass ] 1171 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.opt_hints_subquery [ fail ] Test ended at 2026-04-23 23:55:20 CURRENT_TEST: main.opt_hints_subquery --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_subquery.result 2026-04-17 18:40:40.456799736 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_subquery.reject 2026-04-23 23:55:20.604706632 +0300 @@ -632,7 +632,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Forcing the default strategy should not change anything @@ -643,7 +643,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) SEMIJOIN(@`subq2` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Forcing a strategy for one, may change the other due to cost changes @@ -654,7 +654,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t3) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t3) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Forcing same strategy for both @@ -665,7 +665,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t3) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t3) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) SEMIJOIN(@`subq2` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Loosescan for both is not possible, ends up with DuplicateWeedout @@ -676,7 +676,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) SEMIJOIN(@`subq2` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Swap strategies compared to default @@ -687,7 +687,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) SEMIJOIN(@`subq2` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Different subsets of strategies for different subqueries @@ -699,7 +699,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH, LOOSESCAN) SEMIJOIN(@`subq2` MATERIALIZATION, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Vice versa @@ -711,7 +711,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where; End temporary -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` MATERIALIZATION, DUPSWEEDOUT) SEMIJOIN(@`subq2` FIRSTMATCH, LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Another combination @@ -723,7 +723,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` MATERIALIZATION, FIRSTMATCH) SEMIJOIN(@`subq2` LOOSESCAN, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Turn off default @@ -735,7 +735,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ NO_SEMIJOIN(@`subq1` LOOSESCAN) NO_SEMIJOIN(@`subq2` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Also turn off 2nd choice. Gives DuplicateWeedout over both @@ -747,7 +747,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where; End temporary -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ NO_SEMIJOIN(@`subq1` LOOSESCAN, FIRSTMATCH) NO_SEMIJOIN(@`subq2` FIRSTMATCH, LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Also turn off DuplicateWeedout. Materialization is only one left. @@ -786,7 +786,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary 2 MATERIALIZED t3 index a a 4 NULL 4 100.00 Using index Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` MATERIALIZATION) SEMIJOIN(@`subq2` DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`b` @@ -798,7 +798,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch((sj-nest)) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch((sj-nest)) 2 MATERIALIZED t3 index a a 4 NULL 4 100.00 Using index Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` MATERIALIZATION) SEMIJOIN(@`subq2` LOOSESCAN, FIRSTMATCH, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`b` @@ -810,7 +810,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using where -1 PRIMARY t2 ref a a 4 test.t3.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t3.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t3`.`a` = `test`.`t1`.`a` # Let's turn off FirtMatch, DuplicateWeedout is then chosen @@ -821,7 +821,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL a NULL NULL NULL 4 100.00 Using where; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 100.00 -1 PRIMARY t2 ref a a 4 test.t3.b 1 16.67 Using index; End temporary +1 PRIMARY t2 ref a a 4 test.t3.b 1 25.00 Using index; End temporary Warnings: Note 1003 select /*+ NO_SEMIJOIN(@`subq1` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t1`.`a` = `test`.`t3`.`a` # If we turn off all strategies, DuplicateWeedout should still be used @@ -844,7 +844,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using where -1 PRIMARY t2 ref a a 4 test.t3.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t3.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t3`.`a` = `test`.`t1`.`a` # Force LooseScan, will fall back to DuplicateWeedout @@ -855,7 +855,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL a NULL NULL NULL 4 100.00 Using where; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 100.00 -1 PRIMARY t2 ref a a 4 test.t3.b 1 16.67 Using index; End temporary +1 PRIMARY t2 ref a a 4 test.t3.b 1 25.00 Using index; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t1`.`a` = `test`.`t3`.`a` # Force DuplicateWeedout @@ -866,7 +866,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL a NULL NULL NULL 4 100.00 Using where; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 100.00 -1 PRIMARY t2 ref a a 4 test.t3.b 1 16.67 Using index; End temporary +1 PRIMARY t2 ref a a 4 test.t3.b 1 25.00 Using index; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t1`.`a` = `test`.`t3`.`a` # If FirstMatch is among candidates, it will be used @@ -877,7 +877,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using where -1 PRIMARY t2 ref a a 4 test.t3.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t3.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t3`.`a` = `test`.`t1`.`a` EXPLAIN EXTENDED @@ -888,7 +888,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using where -1 PRIMARY t2 ref a a 4 test.t3.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t3.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` MATERIALIZATION, FIRSTMATCH, LOOSESCAN, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t2`.`a` = `test`.`t3`.`b` and `test`.`t3`.`a` = `test`.`t1`.`a` # Test hints with prepared statements @@ -1184,7 +1184,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; Start temporary 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where; End temporary -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Allowing LooseScan and FirstMatch and optimizer_switch is ignored @@ -1196,7 +1196,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN, FIRSTMATCH) SEMIJOIN(@`subq2` LOOSESCAN, FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Forcing a disabled strategy for one @@ -1207,7 +1207,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Forcing same strategy for both @@ -1218,7 +1218,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t3) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t3) Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) SEMIJOIN(@`subq2` FIRSTMATCH) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Swap strategies compared to default @@ -1229,7 +1229,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH) SEMIJOIN(@`subq2` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Different subsets of strategies for different subqueries @@ -1241,7 +1241,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Note 1003 select /*+ SEMIJOIN(@`subq1` FIRSTMATCH, LOOSESCAN) SEMIJOIN(@`subq2` MATERIALIZATION, DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` # Turn off DuplicateWeedout for both. Materialization is left @@ -1280,7 +1280,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary 2 MATERIALIZED t3 index a a 4 NULL 4 100.00 Using index Warnings: Note 1003 select /*+ NO_SEMIJOIN(@`subq1` DUPSWEEDOUT) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`b` @@ -1492,7 +1492,7 @@ AND t1.b IN (SELECT /*+ QB_NAME(subq2) SEMIJOIN(LOOSESCAN) */ a FROM t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary 2 DEPENDENT SUBQUERY t3 index_subquery a a 4 func 1 100.00 Using index Warnings: Warning 4219 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated @@ -1505,7 +1505,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; Start temporary; End temporary +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; Start temporary; End temporary Warnings: Warning 4219 Hint SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated Warning 4219 Hint SEMIJOIN(@`subq2` FIRSTMATCH) is ignored as conflicting/duplicated @@ -1518,7 +1518,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Warning 4219 Hint SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` @@ -1530,7 +1530,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Warning 4219 Hint NO_SEMIJOIN(@`subq1` LOOSESCAN) is ignored as conflicting/duplicated Note 1003 select /*+ SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t3`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` @@ -1542,7 +1542,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where 1 PRIMARY t3 ref a a 4 test.t1.a 1 100.00 Using index; FirstMatch(t1) -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t3) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t3) Warnings: Warning 4219 Hint NO_SEMIJOIN(@`subq1` FIRSTMATCH) is ignored as conflicting/duplicated Note 1003 select /*+ NO_SEMIJOIN(@`subq1` LOOSESCAN) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) semi join (`test`.`t2`) where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t2`.`a` = `test`.`t1`.`b` @@ -1555,7 +1555,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 4 NULL 4 100.00 Using index; LooseScan 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 25.00 Using where -1 PRIMARY t2 ref a a 4 test.t1.b 1 66.67 Using index; FirstMatch(t1) +1 PRIMARY t2 ref a a 4 test.t1.b 1 100.00 Using index; FirstMatch(t1) Warnings: Warning 1064 Optimizer hint syntax error near 'INTOEXISTS) NO_SEMIJOIN(@subq2 INTOEXISTS) */ * FROM t1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_hints_subquery/' main.opt_trace_default [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.opt_trace_index_merge [ fail ] Test ended at 2026-04-23 23:55:24 CURRENT_TEST: main.opt_trace_index_merge --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_index_merge.result 2026-04-17 18:40:40.459799922 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_index_merge.reject 2026-04-23 23:55:24.014706646 +0300 @@ -17,14 +17,14 @@ 1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 2 Using union(a,b); Using where select * from information_schema.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -explain select * from t1 where a=1 or b=1 { +SELECT context FROM information_schema.optimizer_context { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { - "expanded_query": "select t1.a AS a,t1.b AS b,t1.c AS c,t1.filler AS filler from t1 where t1.a = 1 or t1.b = 1" + "expanded_query": "select information_schema.optimizer_context.`CONTEXT` AS `context` from optimizer_context" } ] } @@ -34,171 +34,21 @@ "select_id": 1, "steps": [ { - "condition_processing": { - "condition": "WHERE", - "original_condition": "t1.a = 1 or t1.b = 1", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "multiple equal(1, t1.a) or multiple equal(1, t1.b)" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "multiple equal(1, t1.a) or multiple equal(1, t1.b)" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "multiple equal(1, t1.a) or multiple equal(1, t1.b)" - } - ] - } - }, - { - "ref_optimizer_key_uses": [] - }, - { "rows_estimation": [ { - "table": "t1", - "range_analysis": { - "table_scan": { - "rows": 1000, - "cost": 0.1729314 - }, - "potential_range_indexes": [ - { - "index": "a", - "usable": true, - "key_parts": ["a"] - }, - { - "index": "b", - "usable": true, - "key_parts": ["b"] - }, - { - "index": "c", - "usable": false, - "cause": "not applicable" - } - ], - "setup_range_conditions": [], - "analyzing_range_alternatives": { - "range_scan_alternatives": [], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - }, - "analyzing_sort_intersect": { - "cutoff_cost": 0.1729314 - }, - "analyzing_index_merge_union": [ - { - "indexes_to_merge": [ - { - "range_scan_alternatives": [ - { - "index": "a", - "ranges": ["(1) <= (a) <= (1)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 1, - "cost": 0.001478954, - "chosen": true - } - ], - "index_to_merge": "a", - "cumulated_cost": 0.001478954 - }, - { - "range_scan_alternatives": [ - { - "index": "b", - "ranges": ["(1) <= (b) <= (1)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 1, - "cost": 0.001478954, - "chosen": true - } - ], - "index_to_merge": "b", - "cumulated_cost": 0.002957908 - } - ], - "cost_of_reading_ranges": 0.002957908, - "use_roworder_union": true, - "cause": "always cheaper than non roworder retrieval", - "analyzing_roworder_scans": [ - { - "type": "range_scan", - "index": "a", - "rows": 1, - "ranges": ["(1) <= (a) <= (1)"], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - }, - { - "type": "range_scan", - "index": "b", - "rows": 1, - "ranges": ["(1) <= (b) <= (1)"], - "analyzing_roworder_intersect": { - "cause": "too few roworder scans" - } - } - ], - "index_roworder_union_cost": 0.005185782, - "members": 2, - "chosen": true - } - ] - }, - "group_index_range": { - "chosen": false, - "cause": "no group by or distinct" - }, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "index_roworder_union", - "union_of": [ - { - "type": "range_scan", - "index": "a", - "rows": 1, - "ranges": ["(1) <= (a) <= (1)"] - }, - { - "type": "range_scan", - "index": "b", - "rows": 1, - "ranges": ["(1) <= (b) <= (1)"] - } - ] - }, - "rows_for_plan": 2, - "cost_for_plan": 0.005185782, - "chosen": true - } + "table": "optimizer_context", + "table_scan": { + "rows": 100, + "read_cost": 0.0211234, + "read_and_compare_cost": 0.0243234 } - }, - { - "selectivity_for_indexes": [ - { - "use_opt_range_condition_rows_selectivity": 0.002 - } - ], - "selectivity_for_columns": [], - "cond_selectivity": 0.002 } ] }, { "table_dependencies": [ { - "table": "t1", + "table": "optimizer_context", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] @@ -212,25 +62,26 @@ "get_costs_for_tables": [ { "best_access_path": { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 }, "considered_access_paths": [ { - "access_type": "index_merge", - "rows": 2, - "rows_after_filter": 2, - "rows_out": 2, - "cost": 0.005185782, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true } ], "chosen_access_method": { - "type": "index_merge", - "rows_read": 2, - "rows_out": 2, - "cost": 0.005185782, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } @@ -239,30 +90,24 @@ }, { "plan_prefix": "", - "table": "t1", - "rows_for_plan": 2, - "cost_for_plan": 0.005185782 + "table": "optimizer_context", + "rows_for_plan": 100, + "cost_for_plan": 0.0243234 } ] }, { - "best_join_order": ["t1"], - "rows": 2, - "cost": 0.005185782 - }, - { - "substitute_best_equal": { - "condition": "WHERE", - "resulting_condition": "t1.a = 1 or t1.b = 1" - } + "best_join_order": ["optimizer_context"], + "rows": 100, + "cost": 0.0243234 }, { "attaching_conditions_to_tables": { "attached_conditions_computation": [], "attached_conditions_summary": [ { - "table": "t1", - "attached_condition": "t1.a = 1 or t1.b = 1" + "table": "optimizer_context", + "attached_condition": null } ] } @@ -329,375 +174,19 @@ 1 SIMPLE t1 index_merge key1,key2,key3 key1,key2 5,5 NULL 77 Using intersect(key1,key2); Using where select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "key1", - "ranges": - ["(100) <= (key1) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2243, - "cost": 2.770351251, - "chosen": true - }, - { - "index": "key2", - "ranges": - ["(100) <= (key2) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2243, - "cost": 2.770351251, - "chosen": false, - "cause": "cost" - }, - { - "index": "key3", - "ranges": - ["(100) <= (key3) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2243, - "cost": 2.770351251, - "chosen": false, - "cause": "cost" - } - ], - "analyzing_roworder_intersect": - { - "intersecting_indexes": - [ - { - "index": "key1", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.240986767, - "disk_sweep_cost": 2.564386012, - "cumulative_total_cost": 2.805372779, - "usable": true, - "matching_rows_now": 2243, - "intersect_covering_with_this_index": false, - "chosen": true - }, - { - "index": "key2", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.481973534, - "disk_sweep_cost": 0.089164506, - "cumulative_total_cost": 0.57113804, - "usable": true, - "matching_rows_now": 77.6360508, - "intersect_covering_with_this_index": false, - "chosen": true - }, - { - "index": "key3", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.722960301, - "disk_sweep_cost": 0, - "cumulative_total_cost": 0.722960301, - "usable": true, - "matching_rows_now": 2.687185191, - "intersect_covering_with_this_index": true, - "chosen": false, - "cause": "does not reduce cost" - } - ], - "clustered_pk": - { - "clustered_pk_added_to_intersect": false, - "cause": "no clustered pk index" - }, - "rows": 77, - "cost": 0.573622393, - "covering": false, - "chosen": true - } - } -] +NULL select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_access_plan": - { - "type": "index_roworder_intersect", - "rows": 77, - "cost": 0.573622393, - "covering": false, - "clustered_pk_scan": false, - "intersect_of": - [ - { - "type": "range_scan", - "index": "key1", - "rows": 2243, - "ranges": - ["(100) <= (key1) <= (100)"] - }, - { - "type": "range_scan", - "index": "key2", - "rows": 2243, - "ranges": - ["(100) <= (key2) <= (100)"] - } - ] - }, - "rows_for_plan": 77, - "cost_for_plan": 0.573622393, - "chosen": true - } -] +NULL # ROR-union(ROR-intersection, ROR-range) explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 154 Using union(intersect(key1,key2),intersect(key3,key4)); Using where select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - }, - "analyzing_index_merge_union": - [ - { - "indexes_to_merge": - [ - { - "range_scan_alternatives": - [ - { - "index": "key1", - "ranges": - ["(100) <= (key1) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2243, - "cost": 0.312922694, - "chosen": true - }, - { - "index": "key2", - "ranges": - ["(100) <= (key2) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2243, - "cost": 0.312922694, - "chosen": false, - "cause": "cost" - } - ], - "index_to_merge": "key1", - "cumulated_cost": 0.312922694 - }, - { - "range_scan_alternatives": - [ - { - "index": "key3", - "ranges": - ["(100) <= (key3) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2243, - "cost": 0.312922694, - "chosen": true - }, - { - "index": "key4", - "ranges": - ["(100) <= (key4) <= (100)"], - "rowid_ordered": true, - "using_mrr": false, - "index_only": true, - "rows": 2243, - "cost": 0.312922694, - "chosen": false, - "cause": "cost" - } - ], - "index_to_merge": "key3", - "cumulated_cost": 0.625845388 - } - ], - "cost_of_reading_ranges": 0.625845388, - "use_roworder_union": true, - "cause": "always cheaper than non roworder retrieval", - "analyzing_roworder_scans": - [ - { - "type": "range_scan", - "index": "key1", - "rows": 2243, - "ranges": - ["(100) <= (key1) <= (100)"], - "analyzing_roworder_intersect": - { - "intersecting_indexes": - [ - { - "index": "key1", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.240986767, - "disk_sweep_cost": 2.564386012, - "cumulative_total_cost": 2.805372779, - "usable": true, - "matching_rows_now": 2243, - "intersect_covering_with_this_index": false, - "chosen": true - }, - { - "index": "key2", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.481973534, - "disk_sweep_cost": 0.089164506, - "cumulative_total_cost": 0.57113804, - "usable": true, - "matching_rows_now": 77.6360508, - "intersect_covering_with_this_index": false, - "chosen": true - } - ], - "clustered_pk": - { - "clustered_pk_added_to_intersect": false, - "cause": "no clustered pk index" - }, - "rows": 77, - "cost": 0.573622393, - "covering": false, - "chosen": true - } - }, - { - "type": "range_scan", - "index": "key3", - "rows": 2243, - "ranges": - ["(100) <= (key3) <= (100)"], - "analyzing_roworder_intersect": - { - "intersecting_indexes": - [ - { - "index": "key3", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.240986767, - "disk_sweep_cost": 2.564386012, - "cumulative_total_cost": 2.805372779, - "usable": true, - "matching_rows_now": 2243, - "intersect_covering_with_this_index": false, - "chosen": true - }, - { - "index": "key4", - "index_scan_cost": 0.240986767, - "cumulated_index_scan_cost": 0.481973534, - "disk_sweep_cost": 0.089164506, - "cumulative_total_cost": 0.57113804, - "usable": true, - "matching_rows_now": 77.6360508, - "intersect_covering_with_this_index": false, - "chosen": true - } - ], - "clustered_pk": - { - "clustered_pk_added_to_intersect": false, - "cause": "no clustered pk index" - }, - "rows": 77, - "cost": 0.573622393, - "covering": false, - "chosen": true - } - } - ], - "index_roworder_union_cost": 1.135493366, - "members": 2, - "chosen": true - } - ] - } -] +NULL select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_access_plan": - { - "type": "index_roworder_union", - "union_of": - [ - { - "type": "index_roworder_intersect", - "rows": 77, - "cost": 0.573622393, - "covering": false, - "clustered_pk_scan": false, - "intersect_of": - [ - { - "type": "range_scan", - "index": "key1", - "rows": 2243, - "ranges": - ["(100) <= (key1) <= (100)"] - }, - { - "type": "range_scan", - "index": "key2", - "rows": 2243, - "ranges": - ["(100) <= (key2) <= (100)"] - } - ] - }, - { - "type": "index_roworder_intersect", - "rows": 77, - "cost": 0.573622393, - "covering": false, - "clustered_pk_scan": false, - "intersect_of": - [ - { - "type": "range_scan", - "index": "key3", - "rows": 2243, - "ranges": - ["(100) <= (key3) <= (100)"] - }, - { - "type": "range_scan", - "index": "key4", - "rows": 2243, - "ranges": - ["(100) <= (key4) <= (100)"] - } - ] - } - ] - }, - "rows_for_plan": 154, - "cost_for_plan": 1.135493366, - "chosen": true - } -] +NULL drop table t0,t1; set optimizer_trace="enabled=off"; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_trace_index_merge/' main.opt_trace_security [ pass ] 76 ReplayTest: Loading context main.opt_trace_ucs2 [ fail ] Test ended at 2026-04-23 23:55:27 CURRENT_TEST: main.opt_trace_ucs2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_ucs2.result 2026-04-17 18:40:40.460799984 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_trace_ucs2.reject 2026-04-23 23:55:26.874706674 +0300 @@ -29,26 +29,5 @@ } select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JS -[ - { - "range_scan_alternatives": - [ - { - "index": "col1", - "ranges": - ["(a) <= (col1)"], - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 0.003808422, - "chosen": true - } - ], - "analyzing_roworder_intersect": - { - "cause": "too few roworder scans" - } - } -] +NULL drop table t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_trace_ucs2/' main.order_by-mdev-10122 [ pass ] 54 ReplayTest: Loading context ReplayTest: Loading context main.order_by_optimizer [ pass ] 31 ReplayTest: Loading context main.order_by_sortkey [ fail ] Test ended at 2026-04-23 23:55:29 CURRENT_TEST: main.order_by_sortkey --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by_sortkey.result 2026-04-02 14:38:09.423657467 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/order_by_sortkey.reject 2026-04-23 23:55:29.732706716 +0300 @@ -176,5 +176,5 @@ if(variable_value in (87701, 87802), 'OK', 'FAIL') as RES from t2 where variable_name='HANDLER_READ_RND_NEXT'; RES -OK +FAIL DROP TABLE t1, tmp, t2; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.order_by_sortkey/' ReplayTest: Loading context main.order_by_zerolength-4285 [ pass ] 33 main.order_fill_sortbuf [ pass ] 279 ReplayTest: Loading context main.outfile [ pass ] 36 main.outfile_loaddata [ pass ] 39 main.overflow [ pass ] 2 main.packet [ pass ] 7 ReplayTest: Loading context ReplayTest: Loading context main.parser [ pass ] 201 main.parser_not_embedded [ pass ] 57 main.parser_stack [ pass ] 1057 main.password_expiration [ pass ] 94 main.perror [ pass ] 40 main.perror-win [ skipped ] Need windows main.plugin_vars [ pass ] 756 main.precedence [ pass ] 1218 ReplayTest: Loading context main.precedence_bugs [ pass ] 23 main.preload [ pass ] 2240 main.prepare [ pass ] 25 main.processlist [ pass ] 5029 main.processlist_notembedded [ pass ] 5059 main.profiling [ pass ] 87 main.ps_10nestset [ pass ] 14 ReplayTest: Loading context main.ps_11bugs [ pass ] 37 main.ps_1general [ pass ] 194 main.ps_2myisam [ pass ] 180 main.ps_4heap [ pass ] 154 main.ps_5merge [ pass ] 330 main.ps_ddl [ pass ] 456 main.ps_ddl1 [ pass ] 88 main.ps_error [ pass ] 1466 main.ps_grant [ pass ] 28 main.ps_max_subselect-5113 [ pass ] 11 main.ps_not_windows [ pass ] 13 main.public_basic [ pass ] 29 main.public_privileges [ pass ] 77 main.query_cache_28249 [ pass ] 32 main.query_cache_merge [ pass ] 625 main.query_cache_ps_no_prot [ pass ] 58 main.query_cache_ps_ps_prot [ skipped ] Test requires: ps-protocol enabled, other protocols disabled main.query_cache_with_views [ pass ] 48 main.quick_select_4161 [ pass ] 14 ReplayTest: Loading context ReplayTest: Loading context main.range_aria_dbt3 [ pass ] 1673 main.range_debug [ pass ] 35 main.read_only [ pass ] 76 main.rename [ pass ] 40 main.renamedb [ pass ] 8 main.repair_symlink-5543 [ pass ] 24 main.replace [ pass ] 6 main.replace_returning [ pass ] 47 main.replace_returning_datatypes [ pass ] 10 main.replace_returning_err [ pass ] 21 create table t_rl (a int); insert into t_rl values (1),(2),(3); explain select * from t_rl where a < 5; ReplayTest: Loading context id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t_rl ALL NULL NULL NULL NULL 3 Using where drop table t_rl; main.replay_loc [ pass ] 6 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.replay_server_test [ fail ] Test ended at 2026-04-23 23:56:32 CURRENT_TEST: main.replay_server_test --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/replay_server_test.result 2026-04-23 22:43:12.062273656 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/replay_server_test.reject 2026-04-23 23:56:32.075547704 +0300 @@ -1,4 +1,11 @@ -REPLAY_SERVER_SOCKET is NOT set +REPLAY_SERVER_SOCKET is set: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock +Checking socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock +Socket exists: YES +Is socket: YES +Replay server PID: 207240 +Process running: YES +Socket directory: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1 +Files in socket dir: mysqld.pid, mysqld.sock, data CREATE TABLE t1 (a INT, b INT, KEY(a)); INSERT INTO t1 VALUES (1,1), (2,2), (3,3); analyze table t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.replay_server_test/' main.reset_connection [ pass ] 15 main.rollback [ pass ] 11 main.round [ pass ] 32 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.row [ pass ] 83 main.rowid_filter [ pass ] 955 main.rowid_filter_aria [ pass ] 2213 main.schema [ pass ] 38 ReplayTest: Loading context main.second_frac-9175 [ pass ] 9 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test" ReplayTest: At line 1498 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'b' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test" ReplayTest: At line 3924 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.select 'nm' [ fail ] Test ended at 2026-04-23 23:56:41 CURRENT_TEST: main.select --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.result 2026-04-17 18:40:40.484801467 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.reject 2026-04-23 23:56:41.564877754 +0300 @@ -657,9 +657,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 @@ -2046,7 +2043,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 @@ -2809,20 +2806,20 @@ INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); explain select max(key1) from t1 where key1 <= 0.6158; 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 max(key2) from t2 where key2 <= 1.6158; 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(key1) from t1 where key1 >= 0.3762; 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(key2) from t2 where key2 >= 1.3762; 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 max(key1), min(key2) from t1, t2 where key1 <= 0.6158 and key2 >= 1.3762; 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 max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range key1 key1 5 NULL 3 Using where; Using index @@ -3908,7 +3905,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -3917,7 +3916,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4001,7 +4002,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -4010,7 +4013,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4150,7 +4155,6 @@ Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4627,12 +4631,6 @@ JOIN t1 y ON x.a=y.a JOIN t1 z ON y.a=z.a WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE x system NULL NULL NULL NULL 1 100.00 -1 SIMPLE y system NULL NULL NULL NULL 1 100.00 -1 SIMPLE z system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1 DROP TABLE t1; # # Bug #49897: crash in ptr_compare when char(0) NOT NULL @@ -4906,10 +4904,7 @@ @cnt 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) +ReplayTest: Query error: FUNCTION test.f1 does not exist DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5703,7 +5698,7 @@ SELECT * FROM t1 WHERE a = 1 AND (3 = 0 OR (SELECT a = 1 OR (SELECT 3 WHERE a = a) = 3)); 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; Using temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.select-nm/' ReplayTest: Loading context main.select_debug [ pass ] 43 ReplayTest: Loading context ReplayTest: Query error: Invalid default value for 'kid' ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_found.test" ReplayTest: At line 76 main.select_found [ fail ] Test ended at 2026-04-23 23:56:44 CURRENT_TEST: main.select_found --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_found.result 2026-04-02 14:38:09.452657388 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_found.reject 2026-04-23 23:56:44.126712660 +0300 @@ -82,9 +82,6 @@ UNIQUE KEY e_n (email,name) ); EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system PRIMARY,kid NULL NULL NULL 0 Const row not found; Using temporary -1 SIMPLE t2 ALL NULL NULL NULL NULL 200 SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10; email email1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.select_found/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_jcl6.test at line 20: ReplayTest: At line 1498 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'b' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_jcl6.test at line 20: ReplayTest: At line 3924 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: FUNCTION test.f1 does not exist ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.select_jcl6 'nm' [ fail ] Test ended at 2026-04-23 23:56:47 CURRENT_TEST: main.select_jcl6 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_jcl6.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/select_jcl6.reject 2026-04-23 23:56:47.600713154 +0300 @@ -669,9 +669,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 @@ -2058,7 +2055,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 @@ -2821,20 +2818,20 @@ INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); explain select max(key1) from t1 where key1 <= 0.6158; 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 max(key2) from t2 where key2 <= 1.6158; 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(key1) from t1 where key1 >= 0.3762; 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(key2) from t2 where key2 >= 1.3762; 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 max(key1), min(key2) from t1, t2 where key1 <= 0.6158 and key2 >= 1.3762; 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 max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range key1 key1 5 NULL 3 Using where; Using index @@ -3920,7 +3917,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -3929,7 +3928,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4013,7 +4014,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; name LENGTH(name) n cc 5 3 @@ -4022,7 +4025,9 @@ cc 3 7 EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range name name 6 NULL 4 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Warning 4253 Failed to parse saved optimizer context: error reading ranges value at offset 376. SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; name LENGTH(name) n cc 4 4 @@ -4162,7 +4167,6 @@ Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4639,12 +4643,6 @@ JOIN t1 y ON x.a=y.a JOIN t1 z ON y.a=z.a WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE x system NULL NULL NULL NULL 1 100.00 -1 SIMPLE y system NULL NULL NULL NULL 1 100.00 -1 SIMPLE z system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1 DROP TABLE t1; # # Bug #49897: crash in ptr_compare when char(0) NOT NULL @@ -4918,10 +4916,7 @@ @cnt 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1(); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (`f1`()) +ReplayTest: Query error: FUNCTION test.f1 does not exist DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5715,7 +5710,7 @@ SELECT * FROM t1 WHERE a = 1 AND (3 = 0 OR (SELECT a = 1 OR (SELECT 3 WHERE a = a) = 3)); 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; Using temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.select_jcl6-nm/' ReplayTest: Loading context ReplayTest: Loading context main.select_safe [ pass ] 37 main.sequence_debug [ pass ] 9 main.servers_upgrade [ pass ] 1464 main.session_user [ pass ] 22 main.set_authorization [ pass ] 1464 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.set_operation [ pass ] 148 ReplayTest: Loading context ReplayTest: Query error: 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 '"t3" ( "e" int(11) DEFAULT NULL, "f" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 12 ReplayTest: Loading context ReplayTest: Query error: 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 '"t1" ( "a" int(11) DEFAULT NULL, "b" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 17 ReplayTest: Loading context ReplayTest: Query error: 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 '"t3" ( "e" int(11) DEFAULT NULL, "f" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 53 ReplayTest: Loading context ReplayTest: Query error: 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 '"t3" ( "e" int(11) DEFAULT NULL, "f" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 57 ReplayTest: Loading context ReplayTest: Query error: 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 '"t1" ( "a" int(11) DEFAULT NULL, "b" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 62 ReplayTest: Loading context ReplayTest: Query error: 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 '"t1" ( "a" int(11) DEFAULT NULL, "b" blob(65535) DEFAULT NULL )' at line 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.test" ReplayTest: At line 66 main.set_operation_oracle [ fail ] Test ended at 2026-04-23 23:56:58 CURRENT_TEST: main.set_operation_oracle --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.result 2026-04-17 18:40:40.487801652 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/set_operation_oracle.reject 2026-04-23 23:56:58.021714742 +0300 @@ -11,19 +11,6 @@ 4 4 explain extended (select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -6 DERIVED ALL NULL NULL NULL NULL 2 100.00 -4 DERIVED ALL NULL NULL NULL NULL 4 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 -3 UNION t2 ALL NULL NULL NULL NULL 2 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from ((/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") union (/* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2")) "__3" intersect (/* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3")) "__5" union (/* select#7 */ select 4 AS "4",4 AS "4")) "__7" (select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4); e f 3 3 @@ -32,19 +19,6 @@ 4 4 explain extended (select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 -6 DERIVED ALL NULL NULL NULL NULL 4 100.00 -4 DERIVED ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -5 UNION t1 ALL NULL NULL NULL NULL 2 100.00 -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from ((/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") intersect (/* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2")) "__3" union (/* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1")) "__5" union (/* select#7 */ select 4 AS "4",4 AS "4")) "__7" create table t12(c1 int); insert into t12 values(1); insert into t12 values(2); @@ -75,34 +49,12 @@ 4 4 explain extended select a,b from t1 union all select c,d from t2 intersect select e,f from t3 union all select 4,'4' from dual; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -6 DERIVED ALL NULL NULL NULL NULL 2 100.00 -4 DERIVED ALL NULL NULL NULL NULL 4 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 -3 UNION t2 ALL NULL NULL NULL NULL 2 100.00 -5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from (/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" intersect /* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7" select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual; a b 3 3 4 4 explain extended select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 100.00 -6 DERIVED ALL NULL NULL NULL NULL 2 100.00 -4 DERIVED ALL NULL NULL NULL NULL 4 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 -3 UNION t2 ALL NULL NULL NULL NULL 2 100.00 -5 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 /* select#1 */ select "__7"."a" AS "a","__7"."b" AS "b" from (/* select#6 */ select "__5"."a" AS "a","__5"."b" AS "b" from (/* select#4 */ select "__3"."a" AS "a","__3"."b" AS "b" from (/* select#2 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" union all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" intersect all /* select#5 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7" select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual; e f 3 3 @@ -111,17 +63,6 @@ 4 4 explain extended select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 -6 DERIVED ALL NULL NULL NULL NULL 4 100.00 -4 DERIVED ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -5 UNION t1 ALL NULL NULL NULL NULL 2 100.00 -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from (/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" union all /* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7" select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual; e f 3 3 @@ -130,17 +71,6 @@ 4 4 explain extended select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 -6 DERIVED ALL NULL NULL NULL NULL 4 100.00 -4 DERIVED ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t3 ALL NULL NULL NULL NULL 2 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -5 UNION t1 ALL NULL NULL NULL NULL 2 100.00 -7 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 /* select#1 */ select "__7"."e" AS "e","__7"."f" AS "f" from (/* select#6 */ select "__5"."e" AS "e","__5"."f" AS "f" from (/* select#4 */ select "__3"."e" AS "e","__3"."f" AS "f" from (/* select#2 */ select "test"."t3"."e" AS "e","test"."t3"."f" AS "f" from "test"."t3" intersect all /* select#3 */ select "test"."t2"."c" AS "c","test"."t2"."d" AS "d" from "test"."t2") "__3" union all /* select#5 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1") "__5" union all /* select#7 */ select 4 AS "4",'4' AS "4") "__7" set SQL_MODE=default; drop table t1,t2,t3; set SQL_MODE=oracle; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.set_operation_oracle/' main.set_password [ pass ] 75 ReplayTest: Loading context main.set_statement [ pass ] 931 main.set_statement_debug [ pass ] 18 main.set_statement_notembedded [ pass ] 2014 main.set_statement_profiling [ pass ] 8 main.show [ pass ] 34 main.show_bad_definer-5553 [ pass ] 10 main.show_create_user [ pass ] 13 main.show_explain_ps [ pass ] 56 main.show_function_with_pad_char_to_full_length [ pass ] 19 main.show_profile [ pass ] 12 main.show_row_order-9226 [ pass ] 10 main.shutdown [ pass ] 338 main.sighup-6580 [ pass ] 9 main.signal [ pass ] 178 main.signal_code [ pass ] 14 main.signal_demo1 [ pass ] 27 main.signal_demo2 [ pass ] 33 main.signal_demo3 [ pass ] 20 main.signal_sqlmode [ pass ] 14 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.single_delete_update [ pass ] 576 main.skip_slave_start [ pass ] 1458 main.slowlog_integrity [ pass ] 66 main.sp-anchor-row-type-cursor [ pass ] 125 main.sp-anchor-row-type-table [ pass ] 106 main.sp-anchor-type [ pass ] 141 main.sp-bugs [ pass ] 70 main.sp-bugs2 [ pass ] 31 main.sp-code [ pass ] 63 main.sp-condition-handler [ pass ] 385 main.sp-cursor [ pass ] 1918 main.sp-default-param [ pass ] 58 main.sp-destruct [ pass ] 78 main.sp-dynamic [ pass ] 61 main.sp-error [ pass ] 242 main.sp-expr [ pass ] 28 main.sp-fib [ pass ] 15 main.sp-for-loop [ pass ] 29 main.sp-i_s_columns [ pass ] 472 main.sp-inout [ pass ] 161 main.sp-lock [ pass ] 124 main.sp-memory-leak [ pass ] 8 main.sp-no-code [ skipped ] Does not run with debug binaries main.sp-no-valgrind [ pass ] 15 main.sp-package [ pass ] 35 main.sp-package-code [ pass ] 27 main.sp-package-security [ pass ] 55 main.sp-prelocking [ pass ] 68 main.sp-security [ pass ] 412 main.sp-security-anchor-type [ pass ] 67 main.sp-security-debug [ pass ] 84 main.sp-sys_refcursor [ pass ] 55 main.sp-threads [ pass ] 28 main.sp-ucs2 [ pass ] 58 main.sp-vars [ pass ] 118 main.sp2 [ pass ] 66 main.sp_gis [ pass ] 25 main.sp_missing_4665 [ pass ] 11 main.sp_notembedded [ pass ] 95 main.sp_stress_case [ pass ] 6606 main.sp_sync [ pass ] 52 main.sp_validation [ pass ] 412 main.spatial_testing_functions_coveredby [ pass ] 70 ReplayTest: Loading context main.spatial_utility_function_geohash [ fail ] Test ended at 2026-04-23 23:58:08 CURRENT_TEST: main.spatial_utility_function_geohash --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/spatial_utility_function_geohash.result 2026-04-17 18:40:40.500802455 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/spatial_utility_function_geohash.reject 2026-04-23 23:58:08.071729461 +0300 @@ -730,7 +730,7 @@ CREATE TABLE t1 AS SELECT ST_POINTFROMGEOHASH("0123", 4326); EXPLAIN t1; Field Type Null Key Default Extra -ST_POINTFROMGEOHASH("0123", 4326) geometry YES NULL +a date YES NULL DROP TABLE t1; # valid inputs SELECT ST_GEOHASH(0,0,1); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.spatial_utility_function_geohash/' main.spatial_utility_function_isvalid [ pass ] 80 main.spatial_utility_function_simplify [ pass ] 41 main.spatial_utility_function_validate [ pass ] 26 main.sql_mode [ pass ] 69 main.sql_mode_pad_char_to_full_length [ pass ] 35 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "./include/common-tests.inc": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl.test at line 29: ReplayTest: At line 1477 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.ssl [ fail ] Test ended at 2026-04-23 23:58:18 CURRENT_TEST: main.ssl --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl.result 2026-04-02 14:38:09.471657337 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl.reject 2026-04-23 23:58:18.131732116 +0300 @@ -655,9 +655,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 @@ -2040,7 +2037,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ssl/' main.ssl_ca [ pass ] 80 main.ssl_cipher_tlsv13 [ pass ] 57 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'name' doesn't have a default value ReplayTest: In included file "./include/common-tests.inc": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl_compress.test at line 19: ReplayTest: At line 1477 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.ssl_compress [ fail ] Test ended at 2026-04-23 23:58:29 CURRENT_TEST: main.ssl_compress --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl_compress.result 2026-04-02 14:38:09.472657334 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ssl_compress.reject 2026-04-23 23:58:29.157735173 +0300 @@ -634,9 +634,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 @@ -2019,7 +2016,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ssl_compress/' main.ssl_connect [ pass ] 1214 main.ssl_crl_clients [ pass ] 124 main.ssl_fp [ pass ] 117 main.ssl_system_ca 'good' [ pass ] 48 main.ssl_timeout [ pass ] 5154 main.stack [ pass ] 17 main.stack-crash [ pass ] 17 main.start_slave_until [ pass ] 9 main.stat_tables-enospc [ pass ] 869 main.stat_tables_missing [ pass ] 13 main.statement-expr [ pass ] 18 main.statistics_close [ pass ] 15 main.status2 [ pass ] 18 main.status_bug17954 [ pass ] 10 main.str_to_datetime_457 [ pass ] 8 main.strict_autoinc_1myisam [ pass ] 9 main.strict_autoinc_3heap [ pass ] 10 main.strings [ pass ] 20 main.subquery_merge [ pass ] 18 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.subselect3 [ fail ] Test ended at 2026-04-23 23:58:57 CURRENT_TEST: main.subselect3 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect3.result 2026-04-17 18:40:40.508802949 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect3.reject 2026-04-23 23:58:57.577743744 +0300 @@ -1167,9 +1167,9 @@ set @@max_heap_table_size= 16384; explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY A ALL NULL NULL NULL NULL 10 +1 PRIMARY E ALL NULL NULL NULL NULL 5 Start temporary +1 PRIMARY A ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) 1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) -1 PRIMARY E ALL NULL NULL NULL NULL 5 Start temporary; Using join buffer (flat, BNL join) 1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) 1 PRIMARY D ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (flat, BNL join) flush status; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect3/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.subselect3_jcl6 [ fail ] Test ended at 2026-04-23 23:58:59 CURRENT_TEST: main.subselect3_jcl6 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect3_jcl6.result 2026-04-02 14:38:09.480657313 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect3_jcl6.reject 2026-04-23 23:58:59.433744337 +0300 @@ -1170,9 +1170,9 @@ set @@max_heap_table_size= 16384; explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY A ALL NULL NULL NULL NULL 10 -1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; Using join buffer (incremental, BNLH join) +1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary +1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY A ALL NULL NULL NULL NULL 10 Using join buffer (incremental, BNL join) 1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (incremental, BNL join) 1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (incremental, BNL join) flush status; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect3_jcl6/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_cache [ pass ] 514 main.subselect_debug [ pass ] 12 ReplayTest: Loading context main.subselect_exists2in_costmat [ pass ] 363 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Field 'cur_date' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test" ReplayTest: At line 51 ReplayTest: Loading context ReplayTest: Query error: Field 'cur_date' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test" ReplayTest: At line 57 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test" ReplayTest: At line 360 ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test" ReplayTest: At line 369 ReplayTest: Loading context main.subselect_extra [ fail ] Test ended at 2026-04-23 23:59:04 CURRENT_TEST: main.subselect_extra --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.result 2026-04-02 14:38:09.482657307 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.reject 2026-04-23 23:59:04.196745878 +0300 @@ -42,22 +42,12 @@ explain extended select * from t1 where id in (select id from t1 as x1 where (t1.cur_date 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.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 1 AS `id`,'2007-04-25 18:30:22' AS `cur_date` from (dual) where 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date explain extended select * from t2 where id in (select id from t2 as x1 where (t2.cur_date 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.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 1 AS `id`,'2007-04-25' AS `cur_date` from (dual) where 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date @@ -434,11 +424,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t3); Using join buffer (flat, BNL join) -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); @@ -449,11 +434,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY ref key1 key1 8 const,const 0 FirstMatch(t3) -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_extra/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Field 'a' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra_no_semijoin.test at line 6: ReplayTest: At line 360 ReplayTest: Loading context ReplayTest: Query error: Field 'a' doesn't have a default value ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra_no_semijoin.test at line 6: ReplayTest: At line 369 ReplayTest: Loading context main.subselect_extra_no_semijoin [ fail ] Test ended at 2026-04-23 23:59:05 CURRENT_TEST: main.subselect_extra_no_semijoin --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra_no_semijoin.result 2026-04-02 14:38:09.482657307 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_extra_no_semijoin.reject 2026-04-23 23:59:05.390746268 +0300 @@ -436,11 +436,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY ALL NULL NULL NULL NULL 3 Using where -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); @@ -451,11 +446,6 @@ SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY ref key1 key1 8 const,const 0 Using where -3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_extra_no_semijoin/' main.subselect_gis [ pass ] 37 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_mat_analyze_json [ pass ] 28 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: 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 error: Lost connection to server during query ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost_bugs.test" ReplayTest: At line 521 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_mat_cost_bugs [ fail ] Test ended at 2026-04-23 23:59:13 CURRENT_TEST: main.subselect_mat_cost_bugs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost_bugs.result 2026-04-17 18:40:40.510803073 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost_bugs.reject 2026-04-23 23:59:13.686749028 +0300 @@ -146,8 +146,8 @@ ) ) IS NULL ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t3 system NULL NULL NULL NULL 0 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary drop table t1, t2, t3; # @@ -162,7 +162,7 @@ SELECT * FROM (SELECT * FROM t2) AS a2 WHERE (SELECT distinct SUM(distinct f3 ) FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table insert into t2 values (1),(2); @@ -170,7 +170,7 @@ SELECT * FROM (SELECT * FROM t2) AS a2 WHERE (SELECT distinct SUM(distinct f3 ) FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index 2 DERIVED t2 ALL NULL NULL NULL NULL 2 set optimizer_switch=@tmp_optimizer_switch; @@ -462,20 +462,18 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b); 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 Using where -2 MATERIALIZED t1 index NULL a 5 NULL 2 100.00 Using index -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<`test`.`t2`.`b`>((`test`.`t2`.`b`,`test`.`t2`.`b` in ( (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t2`.`b` ), (`test`.`t2`.`b` in on distinct_key where `test`.`t2`.`b` = ``.`MIN(a)`)))) +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<`test`.`t2`.`b`>((`test`.`t2`.`b`,(/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where multiple equal(`test`.`t2`.`c`, `test`.`t2`.`b`) having trigcond((`test`.`t2`.`b`) = (min(`test`.`t1`.`a`)))))) set optimizer_switch= 'materialization=off'; SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b); b c EXPLAIN EXTENDED SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b); 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 Using where -2 DEPENDENT SUBQUERY t1 index NULL a 5 NULL 2 100.00 Using index -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<`test`.`t2`.`b`>((`test`.`t2`.`b`,(/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t2`.`b` having trigcond((`test`.`t2`.`b`) = (min(`test`.`t1`.`a`)))))) +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<`test`.`t2`.`b`>((`test`.`t2`.`b`,(/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where multiple equal(`test`.`t2`.`c`, `test`.`t2`.`b`) having trigcond((`test`.`t2`.`b`) = (min(`test`.`t1`.`a`)))))) set optimizer_switch= @optimizer_switch_save; DROP TABLE t1,t2; CREATE TABLE t1 (f1 varchar(10)) ENGINE=MyISAM; @@ -503,9 +501,7 @@ 9 explain select * from t1 where a in (select max(a) from t1 where a < 4) or a > 5; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index idx idx 5 NULL 5 Using where; Using index -2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +ReplayTest: Query error: Lost connection to server during query drop table t1; # # MDEV-13135: subquery with ON expression subject to Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat_cost_bugs/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_notembedded' mysql-test-run: restarting replay server... Removing existing datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data 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 19071 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=19071 --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 212552 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: 19071 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 mysql-test-run: replay server restarted (pid 212552) main.subselect_notembedded [ pass ] 151 main.subselect_nulls [ pass ] 23 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_sj [ fail ] Test ended at 2026-04-23 23:59:28 CURRENT_TEST: main.subselect_sj --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj.result 2026-04-02 14:38:09.486657296 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_sj.reject 2026-04-23 23:59:28.458887785 +0300 @@ -771,8 +771,6 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) show warnings; Level Code Message -Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and (<`test`.`t2`.`d`,`test`.`t1`.`b`>((`test`.`t2`.`d`,(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and (`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -2575,7 +2573,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 index b b 5 NULL 10 Using where; Using index; Start temporary 1 PRIMARY t4 ref c c 5 test.t3.b 1 -1 PRIMARY t1 ALL b NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ref b b 5 test.t3.b 2 1 PRIMARY t2 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (flat, BNL join) SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_sj/' main.subselect_sj_aria [ pass ] 46 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_sj_nonmerged [ pass ] 84 main.subselect_union_rand [ pass ] 14 main.sum_distinct [ pass ] 301 main.symlink [ pass ] 457 ReplayTest: Loading context ReplayTest: Query error: Can't create/write to file '/dev/shm/var_auto_RItt/tmp/foo/t1.MAI' (Errcode: 17 "File exists") ReplayTest: In included file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-myisam-11902.test": ReplayTest: included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-aria-11902.test at line 6: ReplayTest: At line 41 main.symlink-aria-11902 [ fail ] Test ended at 2026-04-23 23:59:35 CURRENT_TEST: main.symlink-aria-11902 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-aria-11902.result 2026-04-02 14:38:09.489657288 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-aria-11902.reject 2026-04-23 23:59:35.143756523 +0300 @@ -23,8 +23,6 @@ index directory="MYSQLTEST_VARDIR/tmp/foo"; insert t1 values (200, 'some'),(201,'some'); explain select a from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL a 5 NULL 2 Using index select a from t1; a 200 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.symlink-aria-11902/' ReplayTest: Loading context ReplayTest: Query error: Can't create/write to file '/dev/shm/var_auto_RItt/tmp/foo/t1.MYI' (Errcode: 17 "File exists") ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-myisam-11902.test" ReplayTest: At line 41 main.symlink-myisam-11902 [ fail ] Test ended at 2026-04-23 23:59:36 CURRENT_TEST: main.symlink-myisam-11902 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-myisam-11902.result 2026-04-02 14:38:09.489657288 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/symlink-myisam-11902.reject 2026-04-23 23:59:36.093756867 +0300 @@ -22,8 +22,6 @@ index directory="MYSQLTEST_VARDIR/tmp/foo"; insert t1 values (200, 'some'),(201,'some'); explain select a from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL a 5 NULL 2 Using index select a from t1; a 200 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.symlink-myisam-11902/' main.synchronization [ pass ] 83 main.system_mysql_db [ pass ] 13 main.system_mysql_db_507 [ pass ] 29 main.system_mysql_db_refs [ pass ] 26 main.system_time_debug [ pass ] 8 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.table_elim_debug [ pass ] 33 main.table_keyinfo-6838 [ pass ] 16 main.table_options [ pass ] 38 main.table_options-5867 [ pass ] 14 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.table_value_constr [ pass ] 299 main.temp_table_frm [ pass ] 1440 main.temp_table_symlink [ pass ] 20 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.temporal_literal [ pass ] 41 main.temporal_scale_4283 [ pass ] 14 main.thread_id_overflow [ pass ] 14 main.timeout [ pass ] 26 main.timezone [ pass ] 51 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.timezone2 [ fail ] Test ended at 2026-04-23 23:59:51 CURRENT_TEST: main.timezone2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/timezone2.result 2026-04-02 14:38:09.494657275 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/timezone2.reject 2026-04-23 23:59:51.792762686 +0300 @@ -687,7 +687,7 @@ 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2010-10-30 02:59:59' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (24 hours before the DST fall back) # @@ -699,7 +699,7 @@ 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` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (less than 24 hours after the DST fall back) # @@ -711,7 +711,7 @@ 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` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Optimized (24 hours after the DST fall back) # @@ -723,7 +723,7 @@ 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2010-11-01 02:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' DROP TABLE t1; SET time_zone=DEFAULT; # @@ -744,7 +744,7 @@ 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2011-03-26 01:59:59' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (24 hours before the DST sprint forward) # @@ -756,7 +756,7 @@ 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` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (less than 24 hours after the DST sprint forward) # @@ -768,7 +768,7 @@ 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` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Optimized (24 hours after the DST sprint forward) # @@ -780,7 +780,7 @@ 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2011-03-28 03:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' DROP TABLE t1; # # Testing a leap second @@ -812,7 +812,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1981-06-30 03:59:59' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (24 hours before the leap second) # @@ -824,7 +824,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (less than 24 hours after the leap second) # @@ -836,7 +836,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (localtimestamp()) +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' # # Not optimized (24 hours after the leap second) # @@ -848,7 +848,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1981-07-02 03:59:59' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-23 23:59:51' DROP TABLE t1; SET time_zone=DEFAULT; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.timezone2/' main.timezone3 [ pass ] 44 main.timezone4 [ pass ] 8 main.timezone_grant [ pass ] 69 main.tlsv13 [ pass ] 4659 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.tmp_table_count-7586 [ fail ] Test ended at 2026-04-24 00:00:04 CURRENT_TEST: main.tmp_table_count-7586 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/tmp_table_count-7586.result 2026-04-02 14:38:09.494657275 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/tmp_table_count-7586.reject 2026-04-24 00:00:04.133767445 +0300 @@ -20,7 +20,7 @@ 3 show status like '%Created_tmp_tables%'; Variable_name Value -Created_tmp_tables 0 +Created_tmp_tables 1 explain select * from (select * from t2) T1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.tmp_table_count-7586/' main.trigger [ pass ] 3442 main.trigger-compat [ pass ] 71 main.trigger_no_defaults-11698 [ pass ] 18 main.trigger_notembedded [ pass ] 2272 main.trigger_null [ pass ] 58 main.truncate [ pass ] 29 main.truncate_coverage [ pass ] 14 main.truncate_notembedded [ pass ] 11 main.type_binary [ pass ] 93 ReplayTest: Loading context ReplayTest: Loading context 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_bit [ pass ] 219 main.type_bool [ pass ] 8 main.type_char [ pass ] 12 ReplayTest: Loading context ReplayTest: Query error: Field 'b' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_date.test" ReplayTest: At line 172 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_date [ fail ] Test ended at 2026-04-24 00:00:23 CURRENT_TEST: main.type_date --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_date.result 2026-04-17 18:40:40.518803568 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_date.reject 2026-04-24 00:00:23.415775189 +0300 @@ -170,8 +170,6 @@ COUNT(*) 0 EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW(); -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 INSERT INTO t1 VALUES (DATE(NOW()), 2); SELECT COUNT(*) FROM t1 WHERE a = NOW(); COUNT(*) @@ -434,9 +432,7 @@ explain select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1_0 ref a a 4 const 1 Using where; Using index -1 SIMPLE t2 index NULL a 4 NULL 2 Using index; Using join buffer (flat, BNL join) -1 SIMPLE t1 index NULL a 4 NULL 2 Using index; Using join buffer (incremental, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1; 1 SET TIMESTAMP=UNIX_TIMESTAMP('2012-01-03 00:00:01'); @@ -663,13 +659,13 @@ 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` = DATE'2015-08-30' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2026-04-24' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'00:00:00'; 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` = DATE'2015-08-30' and (octet_length(DATE'2015-08-30')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2026-04-24' and (octet_length(DATE'2026-04-24')) = 30 + rand() DROP TABLE t1; CREATE TABLE t1 (a DATE); INSERT INTO t1 VALUES ('2015-08-30'),('2015-08-31'); @@ -688,13 +684,13 @@ 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` = DATE'2015-08-31' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2026-04-25' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIME'24:00:00'; 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` = DATE'2015-08-31' and (octet_length(DATE'2015-08-31')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2026-04-25' and (octet_length(DATE'2026-04-25')) = 30 + rand() DROP TABLE t1; # In this example '00:00:00' is not recognized as TIME'00:00:00' # and is treated as DATE'0000-00-00'. Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_date/' ReplayTest: Loading context ReplayTest: Loading context main.type_date_round [ fail ] Test ended at 2026-04-24 00:00:24 CURRENT_TEST: main.type_date_round --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_date_round.result 2026-04-17 18:40:40.518803568 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_date_round.reject 2026-04-24 00:00:24.351775574 +0300 @@ -131,13 +131,13 @@ Warnings: Note 1292 Truncated incorrect datetime value: '2001-01-01 23:59:59.9999999' Note 1292 Truncated incorrect datetime value: '2001-01-01 23:59:59.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-02' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 23:59:59.999999' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 23:59:59.9999999' AND CONCAT(a)='2001-01-02'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: Note 1292 Truncated incorrect datetime value: '2001-01-01 23:59:59.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = DATE'2001-01-02' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 DROP TABLE t1; # # Comparing non-temporal to DATE Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_date_round/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Field 'cur_date' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime.test" ReplayTest: At line 372 ReplayTest: Loading context ReplayTest: Query error: Field 'cur_date' doesn't have a default value ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime.test" ReplayTest: At line 378 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_datetime [ fail ] Test ended at 2026-04-24 00:00:25 CURRENT_TEST: main.type_datetime --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime.result 2026-04-17 18:40:40.518803568 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime.reject 2026-04-24 00:00:25.483776042 +0300 @@ -519,22 +519,12 @@ explain extended select * from t1 where id in (select id from t1 as x1 where (t1.cur_date 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.t1.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 1 AS `id`,'2007-04-25 18:30:22' AS `cur_date` from (dual) where 0 select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id cur_date explain extended select * from t2 where id in (select id from t2 as x1 where (t2.cur_date 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.t2.cur_date' of SELECT #2 was resolved in SELECT #1 -Note 1003 select 1 AS `id`,'2007-04-25' AS `cur_date` from (dual) where 0 select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id cur_date @@ -1089,13 +1079,13 @@ 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` = TIMESTAMP'2001-01-01 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2026-04-24 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00'; 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` = TIMESTAMP'2001-01-01 00:00:00' and (octet_length(TIMESTAMP'2001-01-01 00:00:00')) = 40 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2026-04-24 00:00:00' and (octet_length(TIMESTAMP'2026-04-24 00:00:00')) = 40 + rand() DROP TABLE t1; # # MDEV-8795 Equal expression propagation does not work for temporal literals Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_datetime/' ReplayTest: Loading context ReplayTest: Loading context main.type_datetime_round [ fail ] Test ended at 2026-04-24 00:00:27 CURRENT_TEST: main.type_datetime_round --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime_round.result 2026-04-17 18:40:40.519803629 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_datetime_round.reject 2026-04-24 00:00:26.866358284 +0300 @@ -157,13 +157,13 @@ Warnings: Note 1292 Truncated incorrect datetime value: '20010101235959.9999999' Note 1292 Truncated incorrect datetime value: '20010101235959.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-02 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 23:59:59.999999' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='20010101235959.9999999' AND CONCAT(a)='2001-01-02 00:00:00.000000'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: Note 1292 Truncated incorrect datetime value: '20010101235959.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-02 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 DROP TABLE t1; # # Comparing non-temporal to DATETIME Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_datetime_round/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_decimal [ pass ] 199 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query error: Data truncated for column 'a' at row 1 ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_enum.test" ReplayTest: At line 223 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_enum [ fail ] Test ended at 2026-04-24 00:00:29 CURRENT_TEST: main.type_enum --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_enum.result 2026-04-17 18:40:40.519803629 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_enum.reject 2026-04-24 00:00:28.890553757 +0300 @@ -1853,8 +1853,6 @@ ALTER TABLE t1 ADD PRIMARY KEY (a); EXPLAIN SELECT a FROM t1 WHERE a=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 1 const 1 Using index SELECT a FROM t1 WHERE a=0; a Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_enum/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_float [ pass ] 266 main.type_geometry_mix_int [ pass ] 57 ReplayTest: Loading context main.type_hex_hybrid [ pass ] 32 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_int [ pass ] 275 main.type_interval [ pass ] 10 main.type_json [ pass ] 22 main.type_nchar [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context 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_newdecimal [ pass ] 233 main.type_num [ pass ] 118 main.type_ranges [ pass ] 47 main.type_row [ pass ] 22 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_set [ pass ] 116 main.type_temporal_mariadb53 [ pass ] 16 main.type_temporal_mysql56 [ pass ] 10 main.type_temporal_mysql56_debug [ pass ] 65 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_time [ fail ] Test ended at 2026-04-24 00:00:41 CURRENT_TEST: main.type_time --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_time.result 2026-04-17 18:40:40.522803815 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_time.reject 2026-04-24 00:00:41.760782901 +0300 @@ -557,15 +557,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31'; 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` = TIME'10:20:31' and (octet_length(TIME'10:20:31')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a bigger scale and fractional second truncation # Ok to propagate with precision truncation @@ -581,15 +581,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.123'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31.123000' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.123'; 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` = TIME'10:20:31.123000' and (octet_length(TIME'10:20:31')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a bigger scale and no fractional second truncation # Ok to propagate @@ -607,15 +607,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=8 AND a=TIMESTAMP'2001-01-01 10:20:31.000'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:31' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 10:20:31.000'; 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` = TIME'10:20:31' and (octet_length(TIME'10:20:31')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() DROP TABLE t1; # TIMESTAMP literal with a smaller scale # Ok to propagate @@ -638,7 +638,7 @@ 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` = TIME'10:20:31.123000' and (octet_length(TIME'10:20:31.123000')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59.999999')) = 30 + rand() DROP TABLE t1; # TIME literal with a bigger scale and fractional second truncation # Ok to propagate with precision truncation @@ -815,15 +815,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = TIME'10:20:30' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); 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` = TIME'10:20:30' and (octet_length(TIME'10:20:30')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() # Old mode, TIMESTAMP literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30'; a @@ -834,27 +834,27 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = TIMESTAMP'0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30' AND LENGTH(a)=30+RAND(); 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` = TIMESTAMP'0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-01-00 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = TIMESTAMP'0000-01-00 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0001-00-00 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = TIMESTAMP'0001-00-00 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # Old mode, TIMESTAMP-alike string literal, zero YYYYMMDD, Ok to propagate SELECT * FROM t1 WHERE a='0000-00-00 10:20:30'; a @@ -865,15 +865,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = TIME'10:20:30' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=30+RAND(); 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` = TIME'10:20:30' and (octet_length(TIME'10:20:30')) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() # Old mode, TIMESTAMP-alike literal, non-zero YYYYMMDD, no propagation SELECT * FROM t1 WHERE a='0000-00-01 10:20:30'; a @@ -884,15 +884,15 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=30+RAND(); 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` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 30 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'-838:59:59.999999' and (octet_length(TIME'-838:59:59')) = 30 + rand() DROP TABLE t1; SET @@old_mode=DEFAULT; # @@ -929,9 +929,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a)<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=TIMESTAMP'2015-08-30 00:00:00.1' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -954,9 +954,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a)<=DATE'2015-08-30' AND a='00:00:00'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE TIMESTAMP('2015-08-08',a+RAND())<=DATE'2015-08-30' AND a='00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -1001,9 +1001,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-09-11'); 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # TIME cast + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11'; a @@ -1011,9 +1011,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # TIME literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11'); a @@ -1021,9 +1021,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11'); 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIME'00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # TIME literal + DATE literal SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11'; a @@ -1031,9 +1031,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE'2015-09-11'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = TIME'00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # TIME-alike string literal + DATE cast SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11'); a @@ -1081,9 +1081,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:00:00'); 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # DATE cast + TIME literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00'; a @@ -1091,9 +1091,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '2015-09-11 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # DATE cast + TIME-alike string literal SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00'; a @@ -1121,9 +1121,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00'); 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # DATE literal + TIME literal SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00'; a @@ -1131,9 +1131,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME'00:00:00'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = DATE'2015-09-11' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 # DATE literal + TIME-alike string literal SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)='00:00:00'; a @@ -1246,18 +1246,18 @@ 34:20:30 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 SET @@optimizer_use_condition_selectivity=4; SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; a 34:20:30 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8; 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 +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 `test`.`t1`.`a` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 drop table t1; SET @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set @@old_mode= @save_old_mode; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_time/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_time_6065 [ pass ] 424 ReplayTest: Loading context ReplayTest: Loading context main.type_time_round [ fail ] Test ended at 2026-04-24 00:00:44 CURRENT_TEST: main.type_time_round --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_time_round.result 2026-04-17 18:40:40.522803815 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_time_round.reject 2026-04-24 00:00:44.570784111 +0300 @@ -210,13 +210,13 @@ Warnings: Note 1292 Truncated incorrect time value: '0.9999999' Note 1292 Truncated incorrect time value: '0.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:01' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:00.999999' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0.9999999' AND CONCAT(a)='00:00:01.000000'; 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: Note 1292 Truncated incorrect time value: '0.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'00:00:01' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 DROP TABLE t1; # # Comparing non-temporal to TIME Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_time_round/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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_timestamp '64bit' [ fail ] Test ended at 2026-04-24 00:00:46 CURRENT_TEST: main.type_timestamp --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_timestamp.result 2026-04-17 18:40:40.523803876 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_timestamp.reject 2026-04-24 00:00:45.948784707 +0300 @@ -955,13 +955,13 @@ 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-24 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00'; 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` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00' and (octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00')) = 40 + rand() +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-24 00:00:00' and (octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2026-04-24 00:00:00')) = 40 + rand() DROP TABLE t1; # # End of 10.1 tests @@ -1543,12 +1543,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 02:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-02 00:00:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-02 00:00:00' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where @@ -1558,7 +1558,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:07' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 05:14:07' # # Corner cases: DATETIME values after the supported optimization range # FROM_UNIXTIME(0x7FFFFFFF-24*3600+1) .. FROM_UNIXTIME(0x7FFFFFFF) @@ -1567,7 +1567,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:08' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 05:14:08' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:08'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where @@ -1582,7 +1582,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-19 03:14:07' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-19 05:14:07' # # Corner cases: rounding # @@ -1603,7 +1603,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1292 Truncated incorrect DATETIME value: '1970-01-01 23:59:59.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00.000000' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 23:59:59.999999' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07.999999'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where @@ -1617,7 +1617,7 @@ 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1292 Truncated incorrect DATETIME value: '2038-01-18 03:14:07.9999999' -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:08.000000' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:07.999999' SET sql_mode=DEFAULT; # # NULLIF: Bad TIMESTAMP values preserve DATETIME comparison Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_timestamp-64bit/' main.type_timestamp_round [ pass ] 63 ReplayTest: Loading context main.type_uint [ pass ] 44 main.type_varbinary [ pass ] 6 main.type_varchar_mysql41 [ pass ] 40 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_year [ pass ] 88 ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.myfunc_int does not exist ReplayTest: Loading context ReplayTest: Query error: Incorrect parameters in the call to stored function 'myfunc_int' ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/udf.test" ReplayTest: At line 151 ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.myfunc_int does not exist ReplayTest: Loading context ReplayTest: Query error: Incorrect parameters in the call to stored function 'myfunc_int' ReplayTest: In file "/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/udf.test" ReplayTest: At line 165 ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.fn does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.myfunc_int does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.myfunc_int does not exist ReplayTest: Loading context ReplayTest: Query error: FUNCTION test.myfunc_double does not exist main.udf [ fail ] Test ended at 2026-04-24 00:00:52 CURRENT_TEST: main.udf --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/udf.result 2026-04-02 14:38:09.505657245 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/udf.reject 2026-04-24 00:00:52.103787392 +0300 @@ -100,8 +100,7 @@ create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; -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 +ReplayTest: Query error: FUNCTION test.myfunc_int does not exist drop table t1; CREATE TABLE t1(a INT, b INT); INSERT INTO t1 values (1,1),(2,2); @@ -116,15 +115,9 @@ 1 2 EXPLAIN EXTENDED SELECT myfunc_int(a AS attr_name) FROM t1; -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 -Warnings: -Note 1003 select myfunc_int(`test`.`t1`.`a` AS `attr_name`) AS `myfunc_int(a AS attr_name)` from `test`.`t1` +ReplayTest: Query error: Incorrect parameters in the call to stored function 'myfunc_int' EXPLAIN EXTENDED SELECT myfunc_int(a) FROM t1; -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 -Warnings: -Note 1003 select myfunc_int(`test`.`t1`.`a` AS `a`) AS `myfunc_int(a)` from `test`.`t1` +ReplayTest: Query error: FUNCTION test.myfunc_int does not exist SELECT a,c FROM v1; a c 1 1 @@ -144,25 +137,13 @@ 1 2 EXPLAIN EXTENDED SELECT myfunc_int(MIN(b) xx) as c FROM t1 GROUP BY 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 temporary; Using filesort -Warnings: -Note 1003 select myfunc_int(min(`test`.`t1`.`b`) AS `xx`) AS `c` from `test`.`t1` group by `test`.`t1`.`a` +ReplayTest: Query error: Incorrect parameters in the call to stored function 'myfunc_int' EXPLAIN EXTENDED SELECT test.fn(MIN(b)) as c FROM t1 GROUP BY 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 temporary; Using filesort -Warnings: -Note 1003 select `test`.`fn`(min(`test`.`t1`.`b`)) AS `c` from `test`.`t1` group by `test`.`t1`.`a` +ReplayTest: Query error: FUNCTION test.fn does not exist EXPLAIN EXTENDED SELECT myfunc_int(fn(MIN(b))) as c FROM t1 GROUP BY 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 temporary; Using filesort -Warnings: -Note 1003 select myfunc_int(`fn`(min(`test`.`t1`.`b`)) AS `fn(MIN(b))`) AS `c` from `test`.`t1` group by `test`.`t1`.`a` +ReplayTest: Query error: FUNCTION test.myfunc_int does not exist EXPLAIN EXTENDED SELECT myfunc_int(test.fn(MIN(b))) as c FROM t1 GROUP BY 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 temporary; Using filesort -Warnings: -Note 1003 select myfunc_int(`test`.`fn`(min(`test`.`t1`.`b`)) AS `test.fn(MIN(b))`) AS `c` from `test`.`t1` group by `test`.`t1`.`a` +ReplayTest: Query error: FUNCTION test.myfunc_int does not exist SELECT myfunc_int(MIN(b) xx) as c FROM t1 GROUP BY a; c 1 @@ -437,10 +418,7 @@ INSERT INTO t1 VALUES(1),(50); CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(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 1 AS `1` from `test`.`t1` where `test`.`t1`.`f1` = (1 + myfunc_double(1 AS `1`)) +ReplayTest: Query error: FUNCTION test.myfunc_double does not exist DROP FUNCTION myfunc_double; DROP TABLE t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.udf/' ***Warnings generated in error logs during shutdown after running tests: main.udf 2026-04-24 0:00:51 0 [ERROR] Invalid row in mysql.func table for function '' main.udf_debug_sync [ pass ] 23 main.udf_notembedded [ pass ] 1433 main.udf_query_cache [ pass ] 16 main.union_crash-714 [ pass ] 9 main.update_ignore_216 [ pass ] 9 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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.update_single_to_multi [ fail ] Test ended at 2026-04-24 00:01:08 CURRENT_TEST: main.update_single_to_multi --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_single_to_multi.result 2026-04-02 14:38:09.507657239 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/update_single_to_multi.reject 2026-04-24 00:01:08.043794510 +0300 @@ -386,8 +386,8 @@ 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 26 const 1 Using index condition -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 +1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter 1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where @@ -428,8 +428,8 @@ 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 26 const 1 Using index condition -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 +1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition 1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter 1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where @@ -3566,7 +3566,7 @@ "loops": 1, "rows": 17, "cost": "COST_REPLACED", - "filtered": 79.54545593, + "filtered": 82.35294342, "attached_condition": "partsupp_small.ps_partkey is not null", "using_index": true } @@ -3596,10 +3596,10 @@ "key_length": "5", "used_key_parts": ["l_partkey"], "ref": ["dbt3_s001.partsupp_small.ps_partkey"], - "loops": 420.35, + "loops": 420, "rows": 30, "cost": "COST_REPLACED", - "filtered": 0.237896994, + "filtered": 0.238095239, "using_index": true } } @@ -3682,7 +3682,7 @@ "loops": 1, "rows": 17, "cost": "COST_REPLACED", - "filtered": 79.54545593, + "filtered": 82.35294342, "attached_condition": "partsupp_small.ps_partkey is not null", "using_index": true } @@ -3711,10 +3711,10 @@ "key_length": "5", "used_key_parts": ["l_partkey"], "ref": ["dbt3_s001.partsupp_small.ps_partkey"], - "loops": 420.35, + "loops": 420, "rows": 30, "cost": "COST_REPLACED", - "filtered": 0.237896994, + "filtered": 0.238095239, "using_index": true } } Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.update_single_to_multi/' main.upgrade_MDEV-19650 [ pass ] 1055 main.upgrade_MDEV-23102-1 [ pass ] 1937 main.upgrade_MDEV-23102-2 [ pass ] 1950 main.upgrade_geometrycolumn_procedure_definer [ pass ] 998 main.upgrade_mdev_24363 [ pass ] 973 main.userstat-badlogin-4824 [ pass ] 12 ReplayTest: Loading context ReplayTest: Loading context main.varbinary [ pass ] 33 main.variables_community [ pass ] 9 main.vector_aria [ pass ] 21 main.vector_debug [ pass ] 12 main.vector_funcs [ pass ] 31 main.vector_utf16 [ pass ] 7 main.view_alias [ pass ] 35 main.view_debug [ pass ] 15 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.view_grant [ pass ] 521 main.wait_timeout [ pass ] 6174 main.warnings_engine_disabled [ pass ] 12 main.win_as_arg_to_aggregate_func [ pass ] 21 main.win_avg [ pass ] 5 main.win_big [ pass ] 402 main.win_big-mdev-10092 [ pass ] 24 ReplayTest: Loading context ReplayTest: Loading context main.win_big-mdev-11697 [ pass ] 3263 main.win_bit [ pass ] 16 ReplayTest: Loading context ReplayTest: Loading context main.win_empty_over [ pass ] 17 main.win_first_last_value [ pass ] 15 main.win_i_s [ pass ] 16 main.win_insert_select [ pass ] 13 main.win_lead_lag [ pass ] 15 main.win_min_max [ pass ] 42 main.win_nth_value [ pass ] 11 ReplayTest: Loading context main.win_ntile [ pass ] 28 main.win_orderby [ pass ] 23 main.win_percent_cume [ pass ] 10 main.win_percentile [ pass ] 50 main.win_rank [ pass ] 17 main.win_std [ pass ] 19 main.win_sum [ pass ] 12 main.windows [ skipped ] Need windows main.windows_debug [ skipped ] Need windows main.xa_sync [ pass ] 17 main.xml [ pass ] 44 main.rpl_mysql_upgrade_slave_repo_check 'mix' [ pass ] 4286 main.column_compression_rpl 'mix' [ pass ] 940 main.auth_rpl 'mix' [ pass ] 656 main.invisible_binlog 'mix' [ pass ] 425 main.rpl_mysqldump_slave 'mix' [ pass ] 1505 main.create_or_replace2 'row' [ pass ] 409 main.column_compression_rpl 'row' [ pass ] 1084 main.stat_tables_repl 'row' [ pass ] 435 main.long_unique_bugs_replication 'row' [ pass ] 417 main.auth_rpl 'row' [ pass ] 617 main.invisible_binlog 'row' [ pass ] 377 main.rpl_mysqldump_slave 'row' [ pass ] 1457 main.column_compression_rpl 'stmt' [ pass ] 1000 main.ps_show_log 'stmt' [ pass ] 387 main.auth_rpl 'stmt' [ pass ] 630 main.invisible_binlog 'stmt' [ pass ] 394 main.rpl_mysqldump_slave 'stmt' [ pass ] 1466 -------------------------------------------------------------------------- The servers were restarted 426 times Spent 1579.840 of 4531 seconds executing testcases Completed: Failed 183/1372 tests, 86.66% were successful. Failing test(s): main.pool_of_threads main.ps main.type_varchar main.ctype_utf8mb4_innodb main.ctype_utf8 main.ctype_utf8mb4 main.group_min_max main.show_explain main.subselect_mat_cost main.join_cache main.statistics_json main.innodb_ext_key main.selectivity_innodb_notembedded main.costs main.stat_tables_innodb main.selectivity_innodb main.partition_explicit_prune main.multi_update main.partition_datatype main.partition_mrr_innodb main.view main.index_merge_innodb main.cte_recursive main.subselect_sj2_mat main.delete_use_source main.delete main.derived_opt main.desc_index_min_max main.desc_index_range main.group_min_max_innodb main.index_merge_innodb_notembedded main.optimizer_costs main.range main.range_mrr_icp main.range_vs_index_merge_innodb main.subselect_innodb main.subselect_sj2 main.subselect_sj2_jcl6 main.update main.update_use_source main.ctype_uca_innodb main.delete_use_source_engines main.func_group_innodb main.greedy_optimizer main.index_intersect_innodb main.join_outer_innodb main.opt_trace_index_merge_innodb main.show_explain_json main.subselect2 main.select_pkeycache main.status main.union main.selectivity main.stat_tables main.limit_rows_examined main.opt_context_store_ddls main.opt_trace main.sargable_date_cond main.sp main.explain_non_select main.partition_column main.partition_mrr_aria main.partition_mrr_myisam main.index_merge_myisam main.order_by main.subselect_mat main.opt_context_replay_basic main.selectivity_notembedded main.cset_narrowing main.derived main.derived_cond_pushdown main.derived_view main.distinct_notembedded main.explain_json main.func_str main.group_by main.group_by_cardinality main.insert_returning main.join main.join_cache_cardinality main.key main.myisam_explain_non_select_all main.opt_context_load_stats_basic main.opt_context_store_stats main.opt_hints main.opt_tvc main.order_by_limit_join main.range_notembedded main.range_vs_index_merge main.rowid_filter_myisam main.rownum main.sargable_casefold_notembedded main.subselect main.subselect4 main.subselect_no_exists_to_in main.subselect_no_mat main.subselect_no_opts main.subselect_no_scache main.subselect_no_semijoin main.subselect_sj_jcl6 main.subselect_sj_mat main.table_elim main.user_var main.win main.variables main.myisam main.selectivity_no_engine main.join_outer main.join_outer_jcl6 main.analyze_stmt main.analyze_stmt_privileges2 main.ansi main.binary main.case main.compress main.create main.cte_update_delete main.ctype_collate main.ctype_latin1 main.ctype_uca main.ctype_ucs main.ctype_utf16 main.ctype_utf16_uca main.ctype_utf16le main.ctype_utf32 main.ctype_utf32_uca main.ctype_utf8mb4_heap main.ctype_utf8mb4_myisam main.custom_aggregates_i_s main.delete_single_to_multi main.empty_string_literal main.explain main.fulltext main.func_group main.func_in main.func_isnull main.func_like main.gis main.grant_explain_non_select main.having main.having_cond_pushdown main.index_intersect main.intersect_all main.invisible_field_debug main.mix2_myisam main.mrr_icp_extra main.mysqld_option_err main.null_key main.opt_hints_subquery main.opt_trace_index_merge main.opt_trace_ucs2 main.order_by_sortkey main.replay_server_test main.select main.select_found main.select_jcl6 main.set_operation_oracle main.spatial_utility_function_geohash main.ssl main.ssl_compress main.subselect3 main.subselect3_jcl6 main.subselect_extra main.subselect_extra_no_semijoin main.subselect_mat_cost_bugs main.subselect_sj main.symlink-aria-11902 main.symlink-myisam-11902 main.timezone2 main.tmp_table_count-7586 main.type_date main.type_date_round main.type_datetime main.type_datetime_round main.type_enum main.type_time main.type_time_round main.type_timestamp main.udf main.update_single_to_multi The log files in var/log may give you some hint of what went wrong. If you want to report this error, MariaDB's bug tracker is found at https://jira.mariadb.org Errors/warnings were found in logfiles during server shutdown after running the following sequence(s) of tests: main.statistics_json main.limit_rows_examined main.ctype_utf8mb4_0900_ai_ci_casefold main.ctype_utf8mb4_turkish_ci_casefold main.ctype_utf8mb4_general_ci_ws main.analyze_format_json main.ctype_utf8mb4_unicode_ci_casefold main.ctype_utf8mb4_unicode_520_ci_casefold main.ctype_utf8mb4_general_ci_casefold main.order_by main.ctype_utf8mb4_uca1400_ai_ci_casefold main.ctype_utf8mb4_general1400_as_ci_casefold main.group_by main.myisam main.count_distinct main.constraints main.connect_debug main.connect-no-db main.create main.contributors main.mysqladmin main.mysqld--help main.mysqld_help_crash-9183 main.mysqld_option_err main.mysqld--help-aria main.mysqld--defaults-file main.udf 44 tests were skipped, 38 by the test itself. mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped real 75m31.156s user 20m47.700s sys 3m7.897s psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$