psergey@p16heavy:~/dev-git/11.8-fix-tproc-h-MDEV-37732-q21$ cd .. psergey@p16heavy:~/dev-git$ ls 10.11-cl 10.6-new_mode 12.2-look 12.3-no-lock mariadb-benchmarks 10.11-fix 11.4-look 12.2-look-2 12.3-no-lock-orig modules 10.11-MDEV-38072-order-by 11.4-look-2 12.2-look-2-orig 12.3-review-foj mysql-8.0-boost 10.11-review-innob-stats-method 11.4-look3 12.2-review 12.3-review-hints1-mdev38045 mysql-9.1 10.11-review-innob-stats-method-noc 11.4-ment-2045 12.2-review-MDEV-36523-trace-replay 12.3-review-mdev37330-review-more mysql-9.5 10.11-review-mdev-29360 11.8 12.2-review-MDEV-36523-trace-replay-cl fb-mysql-8.0 offline-git-mariadb 10.11-review-mdev-29360-orig 11.8-fix-tproc-h-MDEV-37732-q21 12.2-review-MDEV-36523-trace-replay-v2 git-cache sysbench 10.6 11.8-fix-tproc-h-MDEV-37732-q21-prep 12.2-review-orig HammerDB tags 10.6-look 11.8-look-connect 12.3 jobt-2026-local tpch-toy 10.6-look-2 11.8-skip-records-in-range 12.3-cl jobt-2026-v2 10.6-ment-2045 12.1 12.3-noc look psergey@p16heavy:~/dev-git$ cd 11.8-skip-records-in-range/ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range$ cdmysq cdmysq: command not found psergey@p16heavy:~/dev-git/11.8-skip-records-in-range$ cd mysql-test/ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls asan.supp collections lib mariadb-stress-test.pl mtr mysql-test-run.pl README suite CMakeFiles dgcov.pl lsan.supp mariadb-test-run mtr.out-of-source out1 README-gcov suite.pm cmake_install.cmake EXTRA_SERVER_QUICKSTART.txt main mariadb-test-run.pl mysql-stress-test.pl psergey-all-apr21.diff README.stress valgrind.supp CMakeLists.txt include Makefile mariadb-test-run.pl.orig mysql-test-run purify.supp std_data var psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 "our" variable $opt_replay_server redeclared at ./mysql-test-run line 298. "our" variable $opt_replay_server_manual redeclared at ./mysql-test-run line 299. Logging: ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled Using suites: main Collecting tests... Installing system database... Starting replay server... Copying /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/install.db to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data... Starting mysqld on port 10011 with socket /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock... Command: /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd --no-defaults --datadir=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data --port=10011 --socket=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock --pid-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.pid --log-error=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.err --general-log=1 --general-log-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log --skip-networking=0 --skip-grant-tables --key-buffer-size=1M --sort-buffer-size=256K --max-heap-table-size=1M Server process started with PID 890720 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 main.max_statement_time [ disabled ] cannot possibly work, depends on timing main.mysql_embedded [ disabled ] Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 main.partition_open_files_limit [ disabled ] open_files_limit check broken by MDEV-18360 main.read_many_rows_innodb [ disabled ] Bug#11748886 2010-11-15 mattiasj report already exists main.tablespace [ disabled ] disabled in MariaDB (no TABLESPACE table attribute) main.mysql_install_db_win_admin [ skipped ] Requires admin privileges main.charset_client_win [ skipped ] Not tested with utf8 command line support main.mariadb-upgrade-service [ skipped ] Requires admin privileges main.openssl_6975 [ skipped ] no or wrong openssl version main.winservice_basic [ skipped ] Requires admin privileges main.winservice_i18n [ skipped ] Requires admin privileges main.connect-abstract [ pass ] 1 main.connect [ pass ] 14432 main.connect2 [ pass ] 39 main.join_cache_notasan [ 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 failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.pool_of_threads [ fail ] Test ended at 2026-04-22 13:54:26 CURRENT_TEST: main.pool_of_threads --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.result 2026-04-02 14:38:09.434657437 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.reject 2026-04-22 13:54:26.724848858 +0300 @@ -628,9 +628,6 @@ fld3 period breaking 1001 explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 const fld1 fld1 4 const 1 -1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 select fld3,period from t2,t1 where companynr*10 = 37*10; fld3 period breaking 9410 @@ -1518,8 +1515,6 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -2013,7 +2008,7 @@ 4181 explain select min(fld1),max(fld1),count(*) from t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) 0 1232609 1199 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' Only 16 of 1420 completed. -------------------------------------------------------------------------- The servers were restarted 4 times Spent 14.503 of 45 seconds executing testcases Failure: Failed 1/5 tests, 80.00% were successful. Failing test(s): main.pool_of_threads 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 6 tests were skipped, 0 by the test itself. mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force "our" variable $opt_replay_server redeclared at ./mysql-test-run line 298. "our" variable $opt_replay_server_manual redeclared at ./mysql-test-run line 299. Logging: ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled Using suites: main Collecting tests... Installing system database... Starting replay server... Copying /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/install.db to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data... Starting mysqld on port 10011 with socket /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock... Command: /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd --no-defaults --datadir=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data --port=10011 --socket=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock --pid-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.pid --log-error=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.err --general-log=1 --general-log-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log --skip-networking=0 --skip-grant-tables --key-buffer-size=1M --sort-buffer-size=256K --max-heap-table-size=1M Server process started with PID 890968 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 main.max_statement_time [ disabled ] cannot possibly work, depends on timing main.mysql_embedded [ disabled ] Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 main.partition_open_files_limit [ disabled ] open_files_limit check broken by MDEV-18360 main.read_many_rows_innodb [ disabled ] Bug#11748886 2010-11-15 mattiasj report already exists main.tablespace [ disabled ] disabled in MariaDB (no TABLESPACE table attribute) main.mysql_install_db_win_admin [ skipped ] Requires admin privileges main.charset_client_win [ skipped ] Not tested with utf8 command line support main.mariadb-upgrade-service [ skipped ] Requires admin privileges main.openssl_6975 [ skipped ] no or wrong openssl version main.winservice_basic [ skipped ] Requires admin privileges main.winservice_i18n [ skipped ] Requires admin privileges main.connect-abstract [ pass ] main.connect [ pass ] 14445 main.connect2 [ pass ] 35 main.join_cache_notasan [ pass ] 60 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.pool_of_threads [ fail ] Test ended at 2026-04-22 13:55:52 CURRENT_TEST: main.pool_of_threads --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.result 2026-04-02 14:38:09.434657437 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.reject 2026-04-22 13:55:52.036738615 +0300 @@ -628,9 +628,6 @@ fld3 period breaking 1001 explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 const fld1 fld1 4 const 1 -1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 select fld3,period from t2,t1 where companynr*10 = 37*10; fld3 period breaking 9410 @@ -1518,8 +1515,6 @@ explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where `test`.`t2`.`companynr` = 34 and `test`.`t2`.`fld4` <> '' select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 @@ -2013,7 +2008,7 @@ 4181 explain select min(fld1),max(fld1),count(*) from t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) 0 1232609 1199 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.pool_of_threads/' main.ssl_encrypted_key 'env' [ pass ] 116 main.ssl_encrypted_key 'file' [ pass ] 106 main.ssl_encrypted_key 'pass' [ pass ] 91 main.optimizer_costs2 [ pass ] 7 main.ipv4_and_ipv6 [ pass ] 438 main.ipv4_as_ipv6 [ pass ] 1170 main.ipv6 [ pass ] 563 main.bind_multiple_addresses_resolution [ pass ] 43 main.bind_address_resolution [ pass ] 39 main.sp_trans_log [ pass ] 116 main.tc_heuristic_recover [ pass ] 3047 main.merge_alter [ pass ] 61 main.mysqlbinlog_row_minimal [ pass ] 234 main.long_unique_bugs [ pass ] 537 main.tmp_space_usage [ pass ] 15382 main.stat_tables_rbr [ pass ] 112 main.ctype_cp932_binlog_row [ pass ] 122 main.mysqlbinlog_row_compressed [ pass ] 133 main.invisible_partition [ pass ] 35 main.mysqlbinlog-innodb [ pass ] 47 main.partition_innodb_stmt [ pass ] 57 main.session_tracker_sysvar [ pass ] 21 main.tmp_table_binlog [ pass ] 26 main.mysqlbinlog [ pass ] 1401 main.mysqlbinlog_stmt_compressed [ pass ] 115 main.set_statement_notembedded_binlog [ pass ] 21 main.partition_binlog_stmt [ pass ] 29 main.backup_lock_binlog [ pass ] 2018 main.lock_tables_lost_commit [ pass ] 32 main.ctype_collate_implicit_def [ pass ] 37 main.ctype_filesystem [ pass ] 5 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ps [ fail ] Test ended at 2026-04-22 13:56:52 CURRENT_TEST: main.ps /home/psergey/dev-git/11.8-skip-records-in-range/client//mariadb-test: Error on delete of '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/f1.txt' (Errcode: 2 "No such file or directory") --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.result 2026-04-17 18:40:40.470800601 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.reject 2026-04-22 13:56:52.367652997 +0300 @@ -2146,8 +2146,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2157,8 +2160,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2168,8 +2174,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2179,8 +2188,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; create function func_1() returns int begin flush tables; return 1; end| @@ -2195,8 +2207,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 prepare abc from "flush tables"; execute abc; @@ -2207,8 +2222,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2218,8 +2236,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2229,8 +2250,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; deallocate prepare abc; @@ -3963,7 +3987,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3978,7 +4002,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3993,7 +4017,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 3 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4008,7 +4032,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4163,7 +4187,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -4178,7 +4202,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -5500,13 +5524,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` SHOW WARNINGS; Level Code Message -Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings # and their content must be the same as in case running the statement # in regular way @@ -5537,8 +5556,6 @@ EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0) PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )"; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows filtered Extra Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ps/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ps/' main.mysqlcheck [ pass ] 2194 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_varchar [ fail ] Test ended at 2026-04-22 13:56:57 CURRENT_TEST: main.type_varchar --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.result 2026-04-17 18:40:40.524803938 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.reject 2026-04-22 13:56:57.783115423 +0300 @@ -112,7 +112,7 @@ 1 SIMPLE t1 ref v v 257 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 257 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -136,7 +136,7 @@ 1 SIMPLE t1 ref v v 258 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -160,7 +160,7 @@ 1 SIMPLE t1 ref v v 259 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -184,7 +184,7 @@ 1 SIMPLE t1 ref v v 260 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -208,7 +208,7 @@ 1 SIMPLE t1 ref v v 261 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(259); select * from t1 where v like 'This is a test' order by v; v @@ -232,7 +232,7 @@ 1 SIMPLE t1 ref v v 262 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 262 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(258); select * from t1 where v like 'This is a test' order by v; v @@ -256,7 +256,7 @@ 1 SIMPLE t1 ref v v 261 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 261 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(257); select * from t1 where v like 'This is a test' order by v; v @@ -280,7 +280,7 @@ 1 SIMPLE t1 ref v v 260 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 260 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(256); select * from t1 where v like 'This is a test' order by v; v @@ -304,7 +304,7 @@ 1 SIMPLE t1 ref v v 259 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 259 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(255); select * from t1 where v like 'This is a test' order by v; v @@ -328,7 +328,7 @@ 1 SIMPLE t1 ref v v 258 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(254); select * from t1 where v like 'This is a test' order by v; v @@ -352,7 +352,7 @@ 1 SIMPLE t1 ref v v 257 const 3 Using where; Using index explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 257 NULL 3 Using where; Using index +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables alter table t1 change v v varchar(253); alter table t1 change v v varchar(254), drop key v; alter table t1 change v v varchar(300), add key (v(10)); @@ -378,7 +378,7 @@ 1 SIMPLE t1 ref v v 13 const 4 Using where explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 3 Using where; Using filesort +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol)) charset=latin1; insert into t1 values ('test', 'something'); @@ -620,8 +620,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index -Warnings: -Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date` SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1; c1 2001-01-01 @@ -631,8 +629,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index -Warnings: -Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date` DROP TABLE IF EXISTS t1,t2; # # MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases @@ -975,15 +971,9 @@ EXPLAIN SELECT * FROM t1 WHERE i>30 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index i i 33 NULL 5 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int` EXPLAIN SELECT * FROM t1 WHERE i>=30 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index i i 33 NULL 5 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int` DROP TABLE t1; SET note_verbosity=DEFAULT; # @@ -1004,8 +994,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1=10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` = "10" of type `int` SELECT * FROM t1 WHERE c1=10; c1 Warnings: @@ -1023,8 +1011,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1<10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` < "10" of type `int` SELECT * FROM t1 WHERE c1<10; c1 a @@ -1052,8 +1038,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 BETWEEN 10 AND 11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` >= "10" of type `int` SELECT * FROM t1 WHERE c1 BETWEEN 10 AND 11; c1 Warnings: @@ -1071,8 +1055,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 BETWEEN 10 AND '11'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` >= "10" of type `int` SELECT * FROM t1 WHERE c1 BETWEEN 10 AND '11'; c1 Warnings: @@ -1090,8 +1072,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN (10,20); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of type `varchar` = "10" of type `int` SELECT * FROM t1 WHERE c1 IN (10,20); c1 Warnings: @@ -1109,8 +1089,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN (_latin1'a' COLLATE latin1_german2_ci,'b'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of collation `latin1_swedish_ci` = "_latin1'a' collate latin1_german2_ci" of collation `latin1_german2_ci` SELECT * FROM t1 WHERE c1 IN (_latin1'a' COLLATE latin1_german2_ci,'b'); c1 a @@ -1120,8 +1098,6 @@ EXPLAIN SELECT * FROM t1 WHERE c1 IN ('a',_latin1'b' COLLATE latin1_german2_ci); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index c1 c1 13 NULL 10 Using where; Using index -Warnings: -Note 1105 Cannot use key `c1` part[0] for lookup: `test`.`t1`.`c1` of collation `latin1_swedish_ci` = "'a'" of collation `latin1_german2_ci` SELECT * FROM t1 WHERE c1 IN ('a',_latin1'b' COLLATE latin1_german2_ci); c1 a @@ -1136,9 +1112,6 @@ EXPLAIN SELECT * FROM t1 WHERE i >= 10 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL i NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "10" of type `int` -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "10" of type `int` SELECT * FROM t1 WHERE i >= 10 ORDER BY i LIMIT 5; a i NULL 10 @@ -1152,43 +1125,27 @@ EXPLAIN UPDATE t1 SET a = 1 WHERE i = 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i < 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i = 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i < 10 ORDER BY a, i LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i = 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN UPDATE t1 SET a = 1 WHERE i < 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i = 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` = "10" of type `int` EXPLAIN DELETE FROM t1 WHERE i < 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where -Warnings: -Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "10" of type `int` DROP TABLE t1; SET note_verbosity=DEFAULT; # Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_varchar/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_varchar/' main.upgrade [ pass ] 108 main.ctype_ucs2_query_cache [ pass ] 38 main.ctype_ucs2_def [ pass ] 37 main.ctype_utf16_def [ pass ] 28 main.ctype_utf32_def [ pass ] 23 main.lowercase_utf8 [ pass ] 6 main.bug47671 [ pass ] 46 main.ctype_utf8_def_upgrade [ pass ] 28 main.mysql_upgrade-34014 [ pass ] 2756 main.ctype_utf8mb4_unicode_ci_def [ pass ] 39 main.ctype_ldml [ pass ] 345 main.grant [ pass ] 508 main.grant2 [ pass ] 214 main.grant4 [ pass ] 92 main.mysqldump [ pass ] 51428 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_innodb [ fail ] Test ended at 2026-04-22 13:58:04 CURRENT_TEST: main.ctype_utf8mb4_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.result 2026-04-02 14:38:09.327657727 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.reject 2026-04-22 13:58:04.160543942 +0300 @@ -1682,10 +1682,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 53 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 53 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 53 const 4 Using where; Using index +1 SIMPLE t1 ref a a 53 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_innodb/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4_innodb/' main.mysqldump-max [ pass ] 921 main.lock_sync [ pass ] 460 main.partition_innodb_semi_consistent [ pass ] 10162 main.mdl_sync [ pass ] 2193 main.crash_commit_before [ pass ] 372 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8 [ fail ] Test ended at 2026-04-22 13:58:28 CURRENT_TEST: main.ctype_utf8 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.result 2026-04-02 14:38:09.324657735 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.reject 2026-04-22 13:58:27.929506287 +0300 @@ -1567,10 +1567,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 40 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 40 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 40 const 4 Using where; Using index +1 SIMPLE t1 ref a a 40 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index @@ -5291,17 +5291,9 @@ # # as in the bug report. EXPLAIN output should still be pretty readable SET NAMES latin1; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ' AS u; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcd�\0081ÂÃÄÅ' AS `abcd�\0081ÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcd�\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` # Test normal utf8 SET NAMES utf8; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃ\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ` # # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT # @@ -5352,7 +5344,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 1 Using where; Using index SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5371,13 +5363,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -5421,7 +5413,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5444,7 +5436,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5473,14 +5465,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5571,7 +5563,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 1 Using where; Using index SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5590,13 +5582,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -5640,7 +5632,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5663,7 +5655,7 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5692,14 +5684,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index +1 SIMPLE t1 range ch ch 183 NULL # Using where; Using index SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5790,7 +5782,7 @@ ch EXPLAIN SELECT ch FROM t1 WHERE ch='admin𝌆'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const 2 Using where SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin𝌆'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin𝌆'; @@ -5809,13 +5801,13 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables +1 SIMPLE t1 ref ch ch 183 const # Using where SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; @@ -9420,8 +9412,6 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,a)=(10,'1e1'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10 and `test`.`t1`.`a` = '1e1' DROP TABLE t1; # # MDEV-8688 Wrong result for SELECT..WHERE varchar_column IN (1,2,3) AND varchar_column=' 1'; @@ -9447,13 +9437,9 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2) AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2) EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (1,2,'x') AND a='1ë1'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '1ë1' and `test`.`t1`.`a` in (1,2,'x') DROP TABLE IF EXISTS t1; # # MDEV-8816 Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A'; @@ -9467,8 +9453,6 @@ SELECT * FROM t1 WHERE c>=_utf8'a' COLLATE utf8_general_ci AND c='A'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`c` = 'A' DROP TABLE t1; # # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4 [ fail ] Test ended at 2026-04-22 13:58:30 CURRENT_TEST: main.ctype_utf8mb4 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.result 2026-04-02 14:38:09.325657732 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.reject 2026-04-22 13:58:29.612503594 +0300 @@ -1592,10 +1592,10 @@ Kali Kali 2+4 EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 53 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 53 NULL 1 Using where; Using index EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 53 const 4 Using where; Using index +1 SIMPLE t1 ref a a 53 const 1 Using where; Using index EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range a a 14 NULL 4 Using where; Using index Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.ctype_utf8mb4/' main.implicit_commit [ pass ] 344 main.ps_3innodb [ pass ] 461 main.strict [ pass ] 122 main.bootstrap [ pass ] 10927 main.multidelete_engine 'aria' [ pass ] 47 main.spatial_utility_function_collect 'aria' [ pass ] 36 main.vector 'aria' [ pass ] 271 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-34413-icp-reverse-order 'innodb' [ pass ] 663 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'innodb' [ pass ] 221 main.multidelete_engine 'innodb' [ pass ] 26 main.spatial_utility_function_collect 'innodb' [ pass ] 72 main.vector 'innodb' [ pass ] 863 main.multidelete_engine 'heap' [ pass ] 11 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-34413-icp-reverse-order 'myisam' [ pass ] 322 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'myisam' [ pass ] 102 main.multidelete_engine 'myisam' [ pass ] 6 main.spatial_utility_function_collect 'myisam' [ pass ] 39 main.vector 'myisam' [ pass ] 203 main.userstat [ pass ] 1154 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.group_min_max 'debug' [ fail ] Test ended at 2026-04-22 13:59:07 CURRENT_TEST: main.group_min_max --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.result 2026-04-17 18:40:40.421797574 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.reject 2026-04-22 13:59:06.655273610 +0300 @@ -1719,8 +1719,6 @@ explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`b` = 'a' and `test`.`t1`.`c` = 'i121' and `test`.`t1`.`a2` >= 'b' explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 Using where; Using index for group-by @@ -1736,8 +1734,6 @@ explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range NULL idx_t2_1 163 NULL 69 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where `test`.`t2`.`b` = 'a' and `test`.`t2`.`c` = 'i121' and `test`.`t2`.`a2` >= 'b' explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by @@ -1965,16 +1961,12 @@ explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`b` = 'c' and `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL idx_t1_2 147 NULL 512 Using where; Using index explain extended select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 13 100.00 Using where; Using index for group-by -Warnings: -Note 1003 select 98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' and `test`.`t1`.`a2` > 'a' select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); count(distinct a1,a2,b) 4 @@ -2081,28 +2073,20 @@ where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 96.30 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 26.37 Using where; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select a1,a2,b,c from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 512 26.37 Using where; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c` explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 96.30 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index @@ -2125,13 +2109,9 @@ explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 392 100.00 Using where; Using index -Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 392 100.00 Using where; Using index -Warnings: -Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where `test`.`t1`.`a1` > 'a' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` create table t4 as select distinct a1, a2, b, c from t1; alter table t4 add unique index idxt4 (a1, a2, b, c); # This is "superseded" by MDEV-7118, and Loose Index Scan is again an option: @@ -2412,7 +2392,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 EXPLAIN SELECT max(b), a FROM t1 GROUP BY a; @@ -2434,7 +2414,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -2447,7 +2427,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 16 +Handler_read_key 21 Handler_read_next 0 Handler_read_retry 0 EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION @@ -2464,7 +2444,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t1 range a a 5 NULL 6 Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; @@ -2486,8 +2466,7 @@ ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index -1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; @@ -2500,7 +2479,7 @@ INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 13 +Handler_read_key 23 Handler_read_next 0 Handler_read_retry 0 DELETE FROM t3; @@ -2509,14 +2488,14 @@ FROM t1 LIMIT 1; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; DELETE FROM t3 WHERE (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) > 10000; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -2679,8 +2658,6 @@ explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a,index a 5 NULL 1 100.00 Using where; Using index for group-by; Using temporary -Warnings: -Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a` drop table t1; CREATE TABLE t1 (a int, b int, c int, d int, KEY foo (c,d,a,b), KEY bar (c,a,b,d)); @@ -2891,7 +2868,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a <=> NULL; id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Select tables optimized away +x x x x x x x x x No matching min/max row SELECT MIN( a ) FROM t1 WHERE a <=> NULL; MIN( a ) NULL @@ -2927,7 +2904,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Select tables optimized away +x x x x x x x x x No matching min/max row SELECT MIN( a ) FROM t1 WHERE a IS NULL; MIN( a ) NULL @@ -3312,8 +3289,6 @@ SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref b b 4 const 1 Using where; Using index -Warnings: -Note 1105 Cannot use key `b` part[1] for lookup: `test`.`t1`.`a` of type `varchar` > "'0' = 'z'" of type `boolean` SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; b min(a) explain @@ -3367,7 +3342,7 @@ EXPLAIN SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range NULL b 10 NULL 3 Using where; Using index for group-by +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; MIN(a) b @@ -3861,8 +3836,6 @@ 1 PRIMARY ALL distinct_key NULL NULL NULL 5 100.00 1 PRIMARY t1_outer ref a a 5 .max(b) 7 100.00 Using index 2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by -Warnings: -Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = ``.`max(b)` set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set @@use_stat_tables=@save_use_stat_tables; explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a); @@ -3870,8 +3843,6 @@ 1 PRIMARY ALL distinct_key NULL NULL NULL 5 100.00 1 PRIMARY t1_outer ref a a 5 .max(b) 7 100.00 Using index 2 MATERIALIZED t1 range NULL a 5 NULL 5 100.00 Using index for group-by -Warnings: -Note 1003 /* select#1 */ select `test`.`t1_outer`.`a` AS `a` from (/* select#2 */ select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where `test`.`t1_outer`.`a` = ``.`max(b)` drop table t1; # # End of 10.0 tests @@ -4020,18 +3991,12 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND DATE'2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "DATE'2001-01-04'" of type `date` EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN DATE'2001-01-04' AND '2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "DATE'2001-01-04'" of type `date` EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a BETWEEN '2001-01-04' AND DATE'2001-01-05' GROUP BY id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL id 27 NULL 64 Using where; Using index -Warnings: -Note 1105 Cannot use key `id` part[1] for lookup: `test`.`t1`.`a` of type `varchar` >= "('2001-01-04')" of type `date` DROP TABLE t1; # # MIN() optimization didn't work correctly with BETWEEN when using too @@ -4041,7 +4006,7 @@ insert into t1 values("bar"),("Cafe"); explain select min(a) from t1 where a between "a" and "Cafe2"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row explain select min(a) from t1 where a between "a" and "Cafeeeeeeeeeeeeeeeeeeeeeeeeee"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 13 NULL 2 Using where; Using index Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_min_max-debug/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.group_min_max-debug/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'c' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain [ fail ] Test ended at 2026-04-22 13:59:14 CURRENT_TEST: main.show_explain --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.result 2026-04-17 18:40:40.488801714 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.reject 2026-04-22 13:59:14.195430969 +0300 @@ -59,10 +59,6 @@ select max(c) from t1 where a < 10; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 10 Using index condition -Warnings: -Note 1003 select max(c) from t1 where a < 10 connection con1; max(c) 9 @@ -83,10 +79,6 @@ explain select max(c) from t1 where a < 10; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan -Warnings: -Note 1003 explain select max(c) from t1 where a < 10 connection con1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan @@ -275,17 +267,7 @@ update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -321,17 +303,7 @@ delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -377,23 +349,8 @@ select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; connection default; explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 explain for connection $thr2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where -Warnings: -Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2 connection con1; a SUBQ 0 0 @@ -526,8 +483,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort 1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a` set @show_explain_probe_select_id=1; SET debug_dbug='+d,show_explain_probe_join_exec_end'; EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ; @@ -639,7 +594,7 @@ WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 0 Using where 2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away set @show_explain_probe_select_id=1; @@ -1264,10 +1219,6 @@ ('ESP','Spanish'),('FRA','French'),('VNM','Vietnamese'); explain SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 system NULL NULL NULL NULL 1 -1 SIMPLE t1 index b b 15 NULL 107 Using where; Using index -1 SIMPLE t3 ref PRIMARY PRIMARY 14 test.t1.b 1 Using index set @show_explain_probe_select_id=1; SET debug_dbug='+d,show_explain_probe_do_select'; SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2; @@ -1298,7 +1249,7 @@ SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 20 3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where set @show_explain_probe_select_id=1; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.show_explain/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.show_explain/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sql_safe_updates [ pass ] 101 main.enforce_storage_engine_opt [ pass ] 53 main.log_state_bug33693 [ pass ] 18 ^[[Fmain.log_tables-big [ pass ] 163039 main.mysql_client_test [ pass ] 37517 main.mysql_client_test_nonblock [ pass ] 36573 main.log_tables [ pass ] 15285 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_mat_cost [ fail ] Test ended at 2026-04-22 14:03:36 CURRENT_TEST: main.subselect_mat_cost --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.result 2026-04-02 14:38:09.484657302 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.reject 2026-04-22 14:03:36.554962987 +0300 @@ -501,7 +501,7 @@ 1 PRIMARY City ALL Country NULL NULL NULL 4079 Using temporary; Using filesort 1 PRIMARY Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using index 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 5.934845 +Last_query_cost 0.024323 EXPLAIN SELECT straight_join City.Name, City.Population FROM Country JOIN City ON City.Country = Country.Code @@ -511,7 +511,7 @@ 1 PRIMARY Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort 1 PRIMARY City ref Country Country 3 world.Country.Code 17 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 7.972473 +Last_query_cost 0.024323 EXPLAIN SELECT City.Name, City.Population FROM Country LEFT JOIN City ON City.Country = Country.Code @@ -521,7 +521,7 @@ 1 PRIMARY Country index NULL PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort 1 PRIMARY City ref Country Country 3 world.Country.Code 17 2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where -Last_query_cost 7.972473 +Last_query_cost 0.024323 SELECT City.Name, City.Population FROM City JOIN Country ON City.Country = Country.Code GROUP BY City.Name Result content mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat_cost/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_mat_cost/' main.log_state [ pass ] 16497 main.create_or_replace [ pass ] 326 main.mysql_upgrade-6984 [ pass ] 2460 main.innodb_load_xa [ skipped ] Need InnoDB plugin main.innodb_ignore_builtin [ pass ] 13 main.init_file [ pass ] 11 main.init_file_longline_3816 [ pass ] 31 ReplayTest: Loading context main.init_connection_query_cache [ fail ] Test ended at 2026-04-22 14:04:00 CURRENT_TEST: main.init_connection_query_cache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/init_connection_query_cache.result 2026-04-02 14:38:09.377657591 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/init_connection_query_cache.reject 2026-04-22 14:04:00.277917913 +0300 @@ -14,8 +14,6 @@ explain extended select * from test.t1 where 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 connection default; disconnect con1; revoke all privileges, grant option from mysqltest1@localhost; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.init_connection_query_cache/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.init_connection_query_cache/' main.init_connect [ pass ] 112 main.ctype_utf8mb4_0900_mem [ pass ] 50 main.delayed_blob [ pass ] 34 main.mysql_upgrade [ skipped ] cannot test minor upgrade for previews ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.join_cache [ fail ] Test ended at 2026-04-22 14:04:22 CURRENT_TEST: main.join_cache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.result 2026-04-17 18:40:40.431798192 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.reject 2026-04-22 14:04:22.391875563 +0300 @@ -459,8 +459,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where -1 SIMPLE City hash_index_merge City_Population,City_Name #hash#$hj:City_Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(City_Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # After Analyze, Query 4 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -861,8 +860,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=3, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -939,8 +937,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=3, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -1069,8 +1066,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -1147,8 +1143,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -1271,8 +1266,7 @@ ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 52 NULL # Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code # Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, Query 10 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1301,8 +1295,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 52 NULL 17 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Part 2, join_cache_level=4, City_Name, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1339,8 +1332,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1413,8 +1405,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1536,8 +1527,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1610,8 +1600,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1733,8 +1722,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1807,8 +1795,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1930,8 +1917,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2004,8 +1990,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2131,8 +2116,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2205,8 +2189,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2235,8 +2218,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2309,8 +2291,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2339,8 +2320,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2413,8 +2393,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2443,8 +2422,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2517,8 +2495,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2547,8 +2524,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2621,8 +2597,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2651,8 +2626,7 @@ WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 SIMPLE City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -2725,8 +2699,7 @@ WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan -1 PRIMARY City ref Population,Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -2958,8 +2931,7 @@ ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 302 NULL 15 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code 24 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -2967,8 +2939,7 @@ (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE Country range Name Name 302 NULL 15 Using index condition; Using where; Rowid-ordered scan -1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set @@use_stat_tables=@save_use_stat_tables; set @@join_cache_level=@save_join_cache_level; @@ -3755,8 +3726,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 1 -1 SIMPLE t4 ref idx idx 5 test.t1.c 1 1 SIMPLE t3 ref idx idx 5 test.t1.d 1 +1 SIMPLE t4 ref idx idx 5 test.t1.c 1 select t1.a, t1.b, t1.c, t1.d, t2.e, t3.f, t4.g from t1,t2,t3,t4 where t2.b=t1.b and t3.d=t1.d and t4.c=t1.c; a b c d e f g @@ -3768,8 +3739,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.b 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE t4 ref idx idx 5 test.t1.c 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t3 ref idx idx 5 test.t1.d 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t4 ref idx idx 5 test.t1.c 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan select t1.a, t1.b, t1.c, t1.d, t2.e, t3.f, t4.g from t1,t2,t3,t4 where t2.b=t1.b and t3.d=t1.d and t4.c=t1.c; a b c d e f g @@ -3917,8 +3888,7 @@ FROM t1 STRAIGHT_JOIN t2 ORDER BY t1.int_key; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL int_key 4 NULL 14 Using index -1 SIMPLE t2 index NULL int_key 4 NULL 2 Using index; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row DROP TABLE t1,t2; SET join_cache_level=@save_join_cache_level; @@ -3954,8 +3924,7 @@ FROM t1 JOIN t2 ON t2.v ORDER BY t2.v; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row DROP TABLE t1,t2; # @@ -4865,8 +4834,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4887,8 +4854,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -4909,8 +4874,6 @@ 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where 1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1 SELECT * FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.c2 = t3.a3) ON t1.pk = t2.d2) LEFT JOIN t4 ON t1.a1 = t4.a4) LEFT JOIN t5 ON t3.a3 = t5.a5; @@ -6038,8 +6001,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Start temporary 1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 10.00 Using where; Using join buffer (flat, BNLH join) 1 PRIMARY t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 10.00 Using index; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`temp`.`f2` = `test`.`t1`.`v1` and `test`.`t2`.`v1` = `test`.`t1`.`v1` DROP TABLE t1,t2,temp; set join_cache_level=@save_join_cache_level; # @@ -6059,7 +6020,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 UNCACHEABLE SUBQUERY t3 system NULL NULL NULL NULL 1 +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE select count(*) from t1 straight_join t2 where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1); count(*) @@ -6114,8 +6075,6 @@ # - table db accessed with hash_ALL: explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.db WHERE Select_priv = PAGE_FAULTS_MINOR; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set join_cache_level=@save_join_cache_level; create table t1 (c1 date not null, key (c1)) engine=innodb; insert t1 values ('2017-12-27'); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.statistics_json [ fail ] Test ended at 2026-04-22 14:04:27 CURRENT_TEST: main.statistics_json --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.result 2026-04-17 18:40:40.504802702 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.reject 2026-04-22 14:04:27.213866287 +0300 @@ -4504,9 +4504,7 @@ 00000000000000000000711C711C711C711C711CE338E338E338E338E33855555555555555555555C671C671C671C671C671388E388E388E388E388EAAAAAAAAAAAAAAAAAAAA1BC71BC71BC71BC71BC78DE38DE38DE38DE38DE3FFFFFFFFFFFFFFFFFFFF explain extended select * from t1_bin where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 58.82 Using where -Warnings: -Note 1003 select `test`.`t1_bin`.`a` AS `a` from `test`.`t1_bin` where `test`.`t1_bin`.`a` between 'a-3a' and 'zzzzzzzzz' +1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 10.00 Using where analyze select * from t1_bin where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_bin ALL NULL NULL NULL NULL 10 10.00 58.82 60.00 Using where @@ -4580,16 +4578,12 @@ explain extended select * from t1_json where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` between 'a-3a' and 'zzzzzzzzz' analyze select * from t1_json where a between 'a-3a' and 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00 60.00 60.00 Using where explain extended select * from t1_json where a < 'b-1a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 select `test`.`t1_json`.`a` AS `a` from `test`.`t1_json` where `test`.`t1_json`.`a` < 'b-1a' analyze select * from t1_json where a > 'zzzzzzzzz'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 10.00 0.00 0.00 Using where @@ -4600,16 +4594,12 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. UPDATE mysql.column_stats SET histogram='{"histogram_hb":"not-histogram"}' WHERE table_name='t1_json'; FLUSH TABLES; explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. UPDATE mysql.column_stats SET histogram='{"histogram_hb":["not-a-bucket"]}' WHERE table_name='t1_json'; @@ -4617,8 +4607,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"no-expected-members":1}]}' WHERE table_name='t1_json'; @@ -4626,8 +4614,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":{}}]}' WHERE table_name='t1_json'; @@ -4635,8 +4621,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: String or number expected at offset 27. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":"not-an-integer"}]}' WHERE table_name='t1_json'; @@ -4644,8 +4628,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":0.25}]}' WHERE table_name='t1_json'; @@ -4653,8 +4635,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. UPDATE mysql.column_stats SET histogram='{"histogram_hb":[{"start":"aaa", "size":0.25, "ndv":1}]}' WHERE table_name='t1_json'; @@ -4669,8 +4649,6 @@ explain select * from t1_json limit 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10 -Warnings: -Warning 4186 Failed to parse histogram for table test.t1_json: Histogram must have at least one bucket at offset 19. create table t2 ( city varchar(100) ); @@ -4685,24 +4663,18 @@ explain extended select * from t2 where city = 'Moscow'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 98.02 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` = 'Moscow' analyze select * from t2 where city = 'Moscow'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 98.02 98.02 Using where explain extended select * from t2 where city = 'Helsinki'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 1.98 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` = 'Helsinki' analyze select * from t2 where city = 'helsinki'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 101.00 1.98 1.98 Using where explain extended select * from t2 where city < 'Lagos'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 101 1.98 Using where -Warnings: -Note 1003 select `test`.`t2`.`city` AS `city` from `test`.`t2` where `test`.`t2`.`city` < 'Lagos' drop table t1_bin; drop table t1_json; drop table t2; @@ -7904,28 +7876,18 @@ explain extended select * from t1 where col1 < 'а'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'а' explain extended select * from t1 where col1 < 'в'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 20.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'в' explain extended select * from t1 where col1 < 'д'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'д' explain extended select * from t1 where col1 < 'ж'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'ж' explain extended select * from t1 where col1 < 'й'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 90.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < 'й' delete from t1; insert into t1 values ('"а'),('"б'),('"в'),('"г'),('"д'),('"е'),('"ж'),('"з'),('"и'),('"й'); @@ -8006,28 +7968,18 @@ explain extended select * from t1 where col1 < '"а'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"а' explain extended select * from t1 where col1 < '"в'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 20.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"в' explain extended select * from t1 where col1 < '"д'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"д' explain extended select * from t1 where col1 < '"ж'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"ж' explain extended select * from t1 where col1 < '"й'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 90.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` < '"й' drop table t1; select JSON_UNQUOTE(CONVERT('"ФФ"' using cp1251)); JSON_UNQUOTE(CONVERT('"ФФ"' using cp1251)) Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.statistics_json/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.statistics_json/' ***Warnings generated in error logs during shutdown after running tests: main.statistics_json 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:24 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: String or number expected at offset 27. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. 2026-04-22 14:04:26 4 [ERROR] Failed to parse histogram for table test.t1_json: Histogram must have at least one bucket at offset 19. main.analyze_engine_stats2 [ pass ] 2952 main.analyze_stmt_prefetch_count [ pass ] 2429 main.host_cache_size_functionality [ pass ] 1466 main.long_unique_innodb [ pass ] 8215 main.insert_debug [ pass ] 63 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'off,unoptimized' [ fail ] Test ended at 2026-04-22 14:04:55 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 14:04:54.562813404 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'on,unoptimized' [ fail ] Test ended at 2026-04-22 14:04:59 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.result~ 2026-04-22 14:04:55.222812122 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.reject 2026-04-22 14:04:59.219804354 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +495,7 @@ select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index +1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where drop table t1,t2,t3; # # Bug mdev-4340: performance regression with extended_keys=on Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-on,unoptimized/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-on,unoptimized/' main.mdev-25830 'unoptimized' [ pass ] 55 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'covering,off' [ fail ] Test ended at 2026-04-22 14:05:05 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 14:05:04.933793233 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'covering,on' [ fail ] Test ended at 2026-04-22 14:05:10 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.result~ 2026-04-22 14:05:05.574267786 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.reject 2026-04-22 14:05:09.627784083 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +495,7 @@ select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index +1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where drop table t1,t2,t3; # # Bug mdev-4340: performance regression with extended_keys=on Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,on/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,on/' main.mdev-25830 'covering' [ pass ] 92 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.rowid_filter_innodb 'normal' [ fail ] Test ended at 2026-04-22 14:05:20 CURRENT_TEST: main.rowid_filter_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.result 2026-04-17 18:40:40.482801343 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.reject 2026-04-22 14:05:19.817764176 +0300 @@ -2435,8 +2435,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const # # 1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index -Warnings: -Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1 drop table t1, t2; # # MDEV-19820: use of rowid filter for innodb table without primary key @@ -2456,8 +2454,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2472,8 +2468,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2511,8 +2505,6 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; a 1 @@ -2527,15 +2519,11 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update EXPLAIN EXTENDED SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter 1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update SET @saved_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,innodb_report_deadlock'; SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; @@ -2587,9 +2575,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2610,9 +2595,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`ch` = `test`.`t2`.`ch2` and `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2650,8 +2632,6 @@ where id=15066 and (match s against ('+"fttest"' in boolean mode)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 fulltext id,s s 0 1 1.64 Using where -Warnings: -Note 1003 select count(0) AS `count(0)` from `test`.`t1` where `test`.`t1`.`id` = 15066 and (match `test`.`t1`.`s` against ('+"fttest"' in boolean mode)) select count(0) from t1 where id=15066 and (match s against ('+"fttest"' in boolean mode)); count(0) @@ -2963,8 +2943,6 @@ ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1; # @@ -3002,16 +2980,12 @@ WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter a,b b|a 5|5 NULL 192 (21%) 21.31 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) @@ -3554,9 +3528,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where 2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond((`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) SELECT * FROM t1 WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.rowid_filter_innodb 'ahi' [ fail ] Test ended at 2026-04-22 14:05:28 CURRENT_TEST: main.rowid_filter_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb,ahi.result~ 2026-04-22 14:05:20.472762894 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb,ahi.reject 2026-04-22 14:05:28.481747204 +0300 @@ -2435,8 +2435,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const # # 1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index -Warnings: -Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1 drop table t1, t2; # # MDEV-19820: use of rowid filter for innodb table without primary key @@ -2456,8 +2454,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2472,8 +2468,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2511,8 +2505,6 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; a 1 @@ -2527,15 +2519,11 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update EXPLAIN EXTENDED SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter 1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update SET @saved_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,innodb_report_deadlock'; SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; @@ -2587,9 +2575,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2610,9 +2595,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`ch` = `test`.`t2`.`ch2` and `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2650,8 +2632,6 @@ where id=15066 and (match s against ('+"fttest"' in boolean mode)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 fulltext id,s s 0 1 1.64 Using where -Warnings: -Note 1003 select count(0) AS `count(0)` from `test`.`t1` where `test`.`t1`.`id` = 15066 and (match `test`.`t1`.`s` against ('+"fttest"' in boolean mode)) select count(0) from t1 where id=15066 and (match s against ('+"fttest"' in boolean mode)); count(0) @@ -2963,8 +2943,6 @@ ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1; # @@ -3002,16 +2980,12 @@ WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter a,b b|a 5|5 NULL 192 (21%) 21.31 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) @@ -3554,9 +3528,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where 2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond((`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) SELECT * FROM t1 WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-ahi/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-ahi/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_innodb_notembedded [ fail ] Test ended at 2026-04-22 14:05:30 CURRENT_TEST: main.selectivity_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.reject 2026-04-22 14:05:30.279743677 +0300 @@ -74,16 +74,7 @@ select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel from information_schema.optimizer_trace; sel -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.035714283 - } - ] -] +NULL set optimizer_trace=@tmp; drop table t0,t1,t10; set histogram_size=@save_histogram_size; @@ -127,7 +118,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -139,14 +130,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col0", - "ranges": - ["1 < col0"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL $query_tbl; EXPLAIN { @@ -161,7 +145,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -173,14 +157,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL # # Check if not being able to infer anything for the first MAX_KEY # columns doesn't prevent further inferences. @@ -202,7 +179,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 99.60784149, + "filtered": 99.21875, "attached_condition": "(t1.col1 > 1 or t1.col2 > 1 or t1.col3 > 1 or t1.col4 > 1 or t1.col5 > 1 or t1.col6 > 1 or t1.col7 > 1 or t1.col8 > 1 or t1.col9 > 1 or t1.col10 > 1 or t1.col11 > 1 or t1.col12 > 1 or t1.col13 > 1 or t1.col14 > 1 or t1.col15 > 1 or t1.col16 > 1 or t1.col17 > 1 or t1.col18 > 1 or t1.col19 > 1 or t1.col20 > 1 or t1.col21 > 1 or t1.col22 > 1 or t1.col23 > 1 or t1.col24 > 1 or t1.col25 > 1 or t1.col26 > 1 or t1.col27 > 1 or t1.col28 > 1 or t1.col29 > 1 or t1.col30 > 1 or t1.col31 > 1 or t1.col32 > 1 or t1.col33 > 1 or t1.col34 > 1 or t1.col35 > 1 or t1.col36 > 1 or t1.col37 > 1 or t1.col38 > 1 or t1.col39 > 1 or t1.col40 > 1 or t1.col41 > 1 or t1.col42 > 1 or t1.col43 > 1 or t1.col44 > 1 or t1.col45 > 1 or t1.col46 > 1 or t1.col47 > 1 or t1.col48 > 1 or t1.col49 > 1 or t1.col50 > 1 or t1.col51 > 1 or t1.col52 > 1 or t1.col53 > 1 or t1.col54 > 1 or t1.col55 > 1 or t1.col56 > 1 or t1.col57 > 1 or t1.col58 > 1 or t1.col59 > 1 or t1.col60 > 1 or t1.col61 > 1 or t1.col62 > 1 or t1.col63 > 1 or t1.col64 > 1 or t1.col65 > 1 or t1.col66 > 1 or t1.col67 > 1 or t1.col68 > 1 or t1.col69 > 1 or t1.col70 > 1 or t1.col71 > 1 or t1.col72 > 1 or t1.col73 > 1 or t1.col74 > 1 or t1.col75 > 1 or t1.col76 > 1 or t1.col77 > 1 or t1.col78 > 1 or t1.col79 > 1 or t1.col80 > 1 or t1.col81 > 1 or t1.col82 > 1 or t1.col83 > 1 or t1.col84 > 1 or t1.col85 > 1 or t1.col86 > 1 or t1.col87 > 1 or t1.col88 > 1 or t1.col89 > 1 or t1.col90 > 1 or t1.col91 > 1 or t1.col92 > 1 or t1.col93 > 1 or t1.col94 > 1 or t1.col95 > 1 or t1.col96 > 1 or t1.col97 > 1 or t1.col98 > 1 or t1.col99 > 1 or t1.col100 > 1 or t1.col101 > 1 or t1.col102 > 1 or t1.col103 > 1 or t1.col104 > 1 or t1.col105 > 1 or t1.col106 > 1 or t1.col107 > 1 or t1.col108 > 1 or t1.col109 > 1 or t1.col110 > 1 or t1.col111 > 1 or t1.col112 > 1 or t1.col113 > 1 or t1.col114 > 1 or t1.col115 > 1 or t1.col116 > 1 or t1.col117 > 1 or t1.col118 > 1 or t1.col119 > 1 or t1.col120 > 1 or t1.col121 > 1 or t1.col122 > 1 or t1.col123 > 1 or t1.col124 > 1 or t1.col125 > 1 or t1.col126 > 1 or t1.col127 > 1 or t1.col128 > 1 or t1.col129 > 1 or t1.col130 > 1 or t1.col131 > 1 or t1.col132 > 1 or t1.col133 > 1 or t1.col134 > 1 or t1.col135 > 1 or t1.col136 > 1 or t1.col137 > 1 or t1.col138 > 1 or t1.col139 > 1 or t1.col140 > 1 or t1.col141 > 1 or t1.col142 > 1 or t1.col143 > 1 or t1.col144 > 1 or t1.col145 > 1 or t1.col146 > 1 or t1.col147 > 1 or t1.col148 > 1 or t1.col149 > 1 or t1.col150 > 1 or t1.col151 > 1 or t1.col152 > 1 or t1.col153 > 1 or t1.col154 > 1 or t1.col155 > 1 or t1.col156 > 1 or t1.col157 > 1 or t1.col158 > 1) and t1.col159 > 1" } } @@ -214,16 +191,7 @@ from information_schema.optimizer_trace; JS -[ - [ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } - ] -] +NULL set optimizer_trace=@trace_tmp; drop table t1; # @@ -260,14 +228,7 @@ from opt_trace; JS -[ - [ - { - "index_name": "PRIMARY", - "selectivity_from_index": 0.005 - } - ] -] +NULL # Must not include 1.79...e308 as cost: select json_detailed(json_extract(trace,'$**.best_access_path')) as JS @@ -276,7 +237,7 @@ JS [ { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -284,22 +245,21 @@ "considered_access_paths": [ { - "access_type": "range", - "range_index": "PRIMARY", - "rows": 5, - "rows_after_filter": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true } ], "chosen_access_method": { - "type": "range", - "index": "PRIMARY", - "rows_read": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.costs [ fail ] Test ended at 2026-04-22 14:05:39 CURRENT_TEST: main.costs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.result 2026-04-17 18:40:40.367794237 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.reject 2026-04-22 14:05:39.397725763 +0300 @@ -7,87 +7,87 @@ explain select sum(e) as "table_scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 -Last_query_cost 0.012556 +Last_query_cost 0.024323 explain select sum(a) as "index scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Range scans should be used if we don't examine all rows in the table # explain select count(a) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Last_query_cost 0.000000 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index -Last_query_cost 0.002747 +Last_query_cost 0.024323 # # Shorter indexes are preferred over longer indexes # explain select sum(a+b) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL ba 9 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 explain select count(*) from t1 where b between 5 and 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index -Last_query_cost 0.002097 +Last_query_cost 0.024323 explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' explain select count(*) from t1 where b > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 explain select count(*) from t1 where d > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 # # Check covering index usage # explain select a,b,c from t1 where a=b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Prefer ref keys over ranges # explain select count(*) from t1 where b=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=2 and c=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda,cba,cb cba 10 const,const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=3 and c between 3 and 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # # Prefer eq keys over ref keys # explain select a,b,e from t1 where a=10 or a=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition -Last_query_cost 0.003126 +Last_query_cost 0.024323 explain select a,b,e from t1 where d=10 or d=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 2 Using index condition -Last_query_cost 0.003291 +Last_query_cost 0.024323 drop table t1; # # MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in @@ -120,8 +120,6 @@ KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) ) ENGINE= InnoDB; explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range l_suppkey l_suppkey 10 NULL 1 Using where; Using index drop table t1; set global InnoDB.optimizer_disk_read_ratio=@save; # @@ -153,48 +151,5 @@ b >= date '1993-06-01' and b < date '1993-06-01' + interval '3' month and exists (select * from t2 where e = t1.a and g < h) group by c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 12.53886553, - "filesort": { - "sort_key": "t1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["PRIMARY", "t1_ix1"], - "loops": 1, - "rows": 7000, - "cost": 1.1518548, - "filtered": 100, - "attached_condition": "t1.b >= DATE'1993-06-01' and t1.b < (DATE'1993-06-01' + interval '3' month)" - } - }, - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["e"], - "ref": ["test.t1.a"], - "loops": 7000, - "rows": 1, - "cost": 6.7528092, - "filtered": 100, - "attached_condition": "t2.g < t2.h", - "first_match": "t1" - } - } - ] - } - } - } -} set max_heap_table_size=@save_mhts; drop table t1, t2; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.delete_innodb [ fail ] Test ended at 2026-04-22 14:05:49 CURRENT_TEST: main.delete_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_innodb.result 2026-04-02 14:38:09.331657716 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/delete_innodb.reject 2026-04-22 14:05:48.819707203 +0300 @@ -16,9 +16,6 @@ a b EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a ALL NULL NULL NULL NULL 3 -1 SIMPLE b ALL NULL NULL NULL NULL 3 DELETE b FROM t1 AS a JOIN t1 AS b; SELECT * FROM t1; c1 @@ -129,81 +126,11 @@ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and @@ -227,81 +154,11 @@ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey = c_custkey and c_nationkey = n_nationkey and @@ -378,81 +235,11 @@ o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation @@ -476,81 +263,11 @@ o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 101 const 1 Using where; Using index -1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index -1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter explain format=json delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "nation", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_n_name"], - "key": "i_n_name", - "key_length": "101", - "used_key_parts": ["n_name"], - "ref": ["const"], - "loops": 1, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "nation.n_name = 'PERU'", - "using_index": true - } - }, - { - "table": { - "table_name": "customer", - "access_type": "ref", - "possible_keys": ["PRIMARY", "i_c_nationkey"], - "key": "i_c_nationkey", - "key_length": "5", - "used_key_parts": ["c_nationkey"], - "ref": ["dbt3_s001.nation.n_nationkey"], - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100, - "using_index": true - } - }, - { - "table": { - "table_name": "orders", - "access_type": "ref", - "possible_keys": ["i_o_orderdate", "i_o_custkey"], - "key": "i_o_custkey", - "key_length": "5", - "used_key_parts": ["o_custkey"], - "ref": ["dbt3_s001.customer.c_custkey"], - "rowid_filter": { - "range": { - "key": "i_o_orderdate", - "used_key_parts": ["o_orderDATE"] - }, - "rows": 119, - "selectivity_pct": 7.933333333 - }, - "loops": 6, - "rows": 15, - "cost": "COST_REPLACED", - "filtered": 7.933333397, - "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'" - } - } - ] - } -} delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and o_custkey in (select c_custkey from customer where c_nationkey in (select n_nationkey from nation @@ -600,9 +317,6 @@ 114 # lineitem should be first and with "Using rowid filter" explain delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using where; Using rowid filter -1 SIMPLE second ref s_receiptDATE s_receiptDATE 4 func 1 Using where; Using index delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); # Should be 0 select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.delete_innodb/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.opt_hints_join_order [ fail ] Test ended at 2026-04-22 14:05:50 CURRENT_TEST: main.opt_hints_join_order --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_join_order.result 2026-04-17 18:40:40.455799675 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_hints_join_order.reject 2026-04-22 14:05:50.065704746 +0300 @@ -30,180 +30,61 @@ # Warning expected: hint must be ignored as malformed (no table names) EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX()*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4224 Hint JOIN_PREFIX() is ignored as malformed -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4224 Hint JOIN_PREFIX(@`q1` ) is ignored as malformed -Note 1003 select /*+ QB_NAME(`q1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Hint must be ignored as malformed (table names are not allowed for the fixed order) EXPLAIN EXTENDED SELECT /*+ JOIN_FIXED_ORDER(t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4224 Hint JOIN_FIXED_ORDER(`t2`) is ignored as malformed -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Hint is applied: QB name is allowed for the fixed order EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qb1)*/ count(*) FROM t2, t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`qb1`) JOIN_FIXED_ORDER(@`qb1`) */ straight_join count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` # Invalid QB name for the fixed order EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qb3)*/ count(*) FROM t2, t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4220 Query block name `qb3` is not found for JOIN_FIXED_ORDER hint -Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` EXPLAIN EXTENDED SELECT /*+ JOIN_FIXED_ORDER()*/ STRAIGHT_JOIN count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select /*+ JOIN_FIXED_ORDER(@`select#1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # JOIN_FIXED_ORDER() cannot be combined with other join order hints EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2) JOIN_FIXED_ORDER()*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ JOIN_FIXED_ORDER() JOIN_PREFIX(t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_FIXED_ORDER(@`select#1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Multiple join order hints of same type are not allowed (except JOIN_ORDER()) EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t1) JOIN_PREFIX(t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t1) JOIN_SUFFIX(t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_SUFFIX(`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Multiple JOIN_ORDER() hints are applied EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2,t1) JOIN_ORDER(@q1 t3,t2)*/ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`,`t1`) JOIN_ORDER(@`q1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Variation of last syntax EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2@q1, t1) JOIN_ORDER(t3, t2@q1)*/ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`@`q1`,`t1`) JOIN_ORDER(@`q1` `t3`,`t2`@`q1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Invalid mix of notations EXPLAIN EXTENDED SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1 t2, t1@q1)*/ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 1064 Optimizer hint syntax error near '@q1)*/ count(*) -FROM t1, t2, t3' at line 2 -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Hint is correct EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(t1@qb1, t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`qb1`) JOIN_SUFFIX(@`qb1` `t1`@`qb1`,`t2`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_PREFIX(@qb1, t2)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 1064 Optimizer hint syntax error near ', t2)*/ count(*) FROM t1, t2' at line 2 -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Invalid table name EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t3)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4221 Unresolved table name `t3` for JOIN_SUFFIX hint -Note 1003 select count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` # Invalid query block name EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(@qbXXX t1)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4220 Query block name `qbXXX` is not found for JOIN_SUFFIX hint -Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_SUFFIX(t1, t2@qb3)*/ count(*) FROM t1, t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4221 Unresolved table name `t2`@`qb3` for JOIN_SUFFIX hint -Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) JOIN_FIXED_ORDER(@qbXXX)*/ count(*) FROM t2, t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -Warnings: -Warning 4220 Query block name `qbXXX` is not found for JOIN_FIXED_ORDER hint -Note 1003 select /*+ QB_NAME(`qb1`) */ count(0) AS `count(*)` from `test`.`t2` join `test`.`t1` # Warning expected as the hint must not confuse `t2` in the subquery # with `t2` in the join EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2@subq)*/ (SELECT /*+ QB_NAME(subq)*/ max(f1) FROM t2) as SQ, f1 FROM t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 20 100.00 -Warnings: -Warning 4221 Unresolved table name `t2`@`subq` for JOIN_PREFIX hint -Note 1003 /* select#1 */ select (/* select#2 */ select /*+ QB_NAME(`subq`) */ max(`test`.`t2`.`f1`) from `test`.`t2`) AS `SQ`,`test`.`t2`.`f1` AS `f1` from `test`.`t2` # No more than 64 join order hints are allowed. It is hard to construct # a test case where 64 hints will be applicable and only one, exceeding # the maximum, will produce a warning. Usually so many hints will conflict @@ -235,45 +116,6 @@ JOIN_ORDER(t2,t1) JOIN_ORDER(t3,t2) JOIN_ORDER(t2,t1) JOIN_ORDER(t3,t2) JOIN_ORDER(t1,t2,t3,t4,t5,t6) */ count(*) FROM t1, t2, t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 4219 Hint JOIN_ORDER(`t1`,`t2`,`t3`,`t4`,`t5`,`t6`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_SUFFIX(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_ORDER(`t3`,`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t1`) */ count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` # Original query with no hints SELECT count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -281,14 +123,6 @@ 10 explain extended SELECT count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Check name resolving SELECT /*+ QB_NAME(q1) JOIN_PREFIX(t3, t2, t2@subq2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t2) AND @@ -298,15 +132,6 @@ explain extended SELECT /*+ QB_NAME(q1) JOIN_PREFIX(t3, t2, t2@subq2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t2) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t2.f1 20 5.00 Using where; FirstMatch(t2); Using join buffer (incremental, BNLH join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 20 100.00 -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_PREFIX(@`q1` `t3`,`t2`,`t2`@`subq2`) */ count(0) AS `count(*)` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2`) join `test`.`t2` join `test`.`t3` where `test`.`t2`.`f1` = `test`.`t2`.`f1` # Check conflicting hints # Second JOIN_PREFIX is conflicting SELECT /*+ JOIN_PREFIX(t3, t2, t1) JOIN_PREFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -319,16 +144,6 @@ explain extended SELECT /*+ JOIN_PREFIX(t3, t2, t1) JOIN_PREFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t2`,`t1`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t3`,`t2`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t5`.`f1` = `test`.`t2`.`f1` # Second JOIN_SUFFIX is conflicting SELECT /*+ JOIN_SUFFIX(t3, t2) JOIN_SUFFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -340,15 +155,6 @@ explain extended SELECT /*+ JOIN_SUFFIX(t3, t2) JOIN_SUFFIX(t2, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -Warnings: -Warning 4219 Hint JOIN_SUFFIX(`t2`,`t1`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Both JOIN_ORDERs applicable SELECT /*+ JOIN_ORDER(t3, t2) JOIN_ORDER(t1, t2, t5@subq2) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -360,14 +166,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (flat, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) JOIN_ORDER(@`select#1` `t1`,`t2`,`t5`@`subq2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # Unresolved table name t7 in JOIN_ORDER hint, hint ignored SELECT /*+ JOIN_ORDER(t1, t7, t5) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -379,15 +177,6 @@ explain extended SELECT /*+ JOIN_ORDER(t1, t7, t5) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 4221 Unresolved table name `t7` for JOIN_ORDER hint -Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # All hints are applicable SELECT /*+ JOIN_PREFIX(t2, t5@subq2, t4@subq1) JOIN_ORDER(t4@subq1, t3) JOIN_SUFFIX(t1) */ count(*) @@ -401,14 +190,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`) JOIN_ORDER(@`select#1` `t4`@`subq1`,`t3`) JOIN_SUFFIX(@`select#1` `t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # Second JOIN_ORDER is ignored SELECT /*+ JOIN_ORDER(t3, t2) JOIN_ORDER(t2, t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -420,15 +201,6 @@ explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_ORDER(t2, t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -Warnings: -Warning 4219 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # JOIN_SUFFIX is ignored SELECT /*+ JOIN_ORDER(t3, t2) JOIN_SUFFIX(t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -440,15 +212,6 @@ explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_SUFFIX(t3) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -Warnings: -Warning 4219 Hint JOIN_SUFFIX(`t3`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # JOIN_PREFIX is ignored SELECT /*+ JOIN_ORDER(t3, t2) JOIN_PREFIX(t2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -460,15 +223,6 @@ explain extended SELECT /*+ JOIN_ORDER(t3, t2) JOIN_PREFIX(t2) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t2`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # All hints are applicable SELECT /*+ JOIN_ORDER(t4@subq1, t3) JOIN_SUFFIX(t1) JOIN_PREFIX(t2, t5@subq2, t4@subq1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -480,14 +234,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t4`@`subq1`,`t3`) JOIN_SUFFIX(@`select#1` `t1`) JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_PREFIX with all tables. SELECT /*+ JOIN_PREFIX(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -499,14 +245,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_SUFFIX with all tables. SELECT /*+ JOIN_SUFFIX(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -518,14 +256,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_ORDER with all tables. SELECT /*+ JOIN_ORDER(t2, t5@subq2, t4@subq1, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -537,14 +267,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_PREFIX, JOIN_ORDER, JOIN_SUFFIX with all tables. SELECT /*+ JOIN_SUFFIX(t2, t5@subq2, t4@subq1, t3, t1) JOIN_ORDER(t2, t5@subq2, t4@subq1, t3, t1) @@ -560,14 +282,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) JOIN_ORDER(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) JOIN_PREFIX(@`select#1` `t2`,`t5`@`subq2`,`t4`@`subq1`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # JOIN_ORDER is ignored due to STRAIGHT_JOIN. SELECT /*+ QB_NAME(q1) JOIN_ORDER(t2, t1) */ STRAIGHT_JOIN count(*) FROM t1 JOIN t2 JOIN t3 @@ -581,15 +295,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -3 MATERIALIZED t5 ALL PRIMARY NULL NULL NULL 1 100.00 -2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Warning 4219 Hint JOIN_ORDER(`t2`,`t1`) is ignored as conflicting/duplicated -Note 1003 /* select#1 */ select /*+ QB_NAME(`q1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` where <`test`.`t1`.`f1`>((`test`.`t1`.`f1`,(/* select#2 */ select /*+ QB_NAME(`subq1`) */ `test`.`t4`.`f1` from `test`.`t4` where (`test`.`t1`.`f1`) = `test`.`t4`.`f1`))) and <`test`.`t2`.`f1`>((`test`.`t2`.`f1`,`test`.`t2`.`f1` in ( (/* select#3 */ select /*+ QB_NAME(`subq2`) */ `test`.`t5`.`f1` from `test`.`t5` ), (`test`.`t2`.`f1` in on distinct_key where `test`.`t2`.`f1` = ``.`f1`)))) # Test JOIN_FIXED_ORDER. SELECT /*+ QB_NAME(q1) JOIN_FIXED_ORDER(@q1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) @@ -599,14 +304,6 @@ explain extended SELECT /*+ QB_NAME(q1) JOIN_FIXED_ORDER(@q1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -3 MATERIALIZED t5 ALL PRIMARY NULL NULL NULL 1 100.00 -2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select /*+ QB_NAME(`q1`) JOIN_FIXED_ORDER(@`q1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` where <`test`.`t1`.`f1`>((`test`.`t1`.`f1`,(/* select#2 */ select /*+ QB_NAME(`subq1`) */ `test`.`t4`.`f1` from `test`.`t4` where (`test`.`t1`.`f1`) = `test`.`t4`.`f1`))) and <`test`.`t2`.`f1`>((`test`.`t2`.`f1`,`test`.`t2`.`f1` in ( (/* select#3 */ select /*+ QB_NAME(`subq2`) */ `test`.`t5`.`f1` from `test`.`t5` ), (`test`.`t2`.`f1` in on distinct_key where `test`.`t2`.`f1` = ``.`f1`)))) SELECT /*+ JOIN_FIXED_ORDER() */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -615,14 +312,6 @@ explain extended SELECT /*+ JOIN_FIXED_ORDER() */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -3 MATERIALIZED t5 ALL PRIMARY NULL NULL NULL 1 100.00 -2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select /*+ JOIN_FIXED_ORDER(@`select#1`) */ straight_join count(0) AS `count(*)` from `test`.`t1` join `test`.`t2` join `test`.`t3` where <`test`.`t1`.`f1`>((`test`.`t1`.`f1`,(/* select#2 */ select /*+ QB_NAME(`subq1`) */ `test`.`t4`.`f1` from `test`.`t4` where (`test`.`t1`.`f1`) = `test`.`t4`.`f1`))) and <`test`.`t2`.`f1`>((`test`.`t2`.`f1`,`test`.`t2`.`f1` in ( (/* select#3 */ select /*+ QB_NAME(`subq2`) */ `test`.`t5`.`f1` from `test`.`t5` ), (`test`.`t2`.`f1` in on distinct_key where `test`.`t2`.`f1` = ``.`f1`)))) SELECT /*+ QB_NAME(q1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); @@ -631,14 +320,6 @@ explain extended SELECT /*+ QB_NAME(q1) */ count(*) FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Testing STRAIGHT_JOIN SELECT count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -646,14 +327,6 @@ 10 explain extended SELECT count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # t3 can not be first SELECT /*+ JOIN_PREFIX(t3, t1) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -663,15 +336,6 @@ Warning 4219 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated explain extended SELECT /*+ JOIN_PREFIX(t3, t1) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t3`,`t1`) is ignored as conflicting/duplicated -Note 1003 select count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Hint is applicable SELECT /*+ JOIN_PREFIX(t1, t2, t3) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -679,15 +343,6 @@ 10 explain extended SELECT /*+ JOIN_PREFIX(t1, t2, t3) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`,`t2`,`t3`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t5`.`f1` = `test`.`t2`.`f1` # Hint is applicable SELECT /*+ JOIN_SUFFIX(t4, t5) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); @@ -695,14 +350,6 @@ 10 explain extended SELECT /*+ JOIN_SUFFIX(t4, t5) */ count(*) FROM t1 JOIN t2 STRAIGHT_JOIN t3 WHERE t1.f1 IN (SELECT f1 FROM t4) AND t2.f1 IN (SELECT f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t3); Using join buffer (incremental, BNLH join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t4`,`t5`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` straight_join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t5`.`f1` = `test`.`t2`.`f1` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_ORDER(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -714,14 +361,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (flat, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 50.00 Using where; FirstMatch(t1); Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_ORDER(@`q1` `t2`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_PREFIX(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -733,15 +372,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 100.00 -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_PREFIX(@`q1` `t2`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t5`.`f1` = `test`.`t2`.`f1` # Alternative syntax SELECT /*+ QB_NAME(q1) JOIN_SUFFIX(@q1 t2, t3, t1) */ count(*) FROM t1 JOIN t2 JOIN t3 @@ -753,14 +383,6 @@ FROM t1 JOIN t2 JOIN t3 WHERE t1.f1 IN (SELECT /*+ QB_NAME(subq1) */ f1 FROM t4) AND t2.f1 IN (SELECT /*+ QB_NAME(subq2) */ f1 FROM t5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t5 ALL PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t5.f1 20 11.11 Using where; Using join buffer (incremental, BNLH join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (incremental, BNL join) -1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t4.f1 3 16.67 Using where; End temporary; Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select /*+ QB_NAME(`q1`) JOIN_SUFFIX(@`q1` `t2`,`t3`,`t1`) */ count(0) AS `count(*)` from `test`.`t5` semi join (`test`.`t4`) join `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t1`.`f1` = `test`.`t4`.`f1` and `test`.`t2`.`f1` = `test`.`t5`.`f1` DROP TABLE t1, t2, t3, t4 ,t5, t6; # Testing embedded join CREATE TABLE t1 (f1 INT); @@ -771,78 +393,30 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Warning 4219 Hint JOIN_ORDER(`t2`,`t4`,`t1`) is ignored as conflicting/duplicated -Note 1003 select 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t2, t1, t4) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t1`,`t4`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t4, t1, t2) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t4`,`t1`,`t2`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t3, t4) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t3`,`t4`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN SELECT /*+ JOIN_ORDER(t4, t3) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join) EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t1) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t1`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 EXPLAIN EXTENDED SELECT /*+ JOIN_SUFFIX(t2, t1) */ 1 FROM t1 JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t4 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t1`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on(1 and 1) join `test`.`t4` where 1 DROP TABLE t1, t2, t3, t4; CREATE TABLE t1 ( @@ -873,79 +447,31 @@ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 delete from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta2) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta2`) */ from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta1, ta2) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta1`,`ta2`) */ from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Applicable hint EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(t2, t3, ta2, ta1) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 Using where -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 33.33 Using where -Warnings: -Note 1003 delete /*+ JOIN_PREFIX(@`select#1` `t2`,`t3`,`ta2`,`ta1`) */ from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Hint should be ignored EXPLAIN EXTENDED DELETE /*+ JOIN_SUFFIX(ta2, t3, ta1) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Warning 4219 Hint JOIN_SUFFIX(`ta2`,`t3`,`ta1`) is ignored as conflicting/duplicated -Note 1003 delete from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 # Both hints are ignored EXPLAIN EXTENDED DELETE /*+ JOIN_PREFIX(ta1, t2, t3) JOIN_SUFFIX(t3, ta2) */ FROM ta1.* USING t1 AS ta1 JOIN t1 AS ta2 ON 1 RIGHT OUTER JOIN t2 ON (ta1.f1 = t2.f1) WHERE (9) IN (SELECT f1 FROM t3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY ta1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 100.00 Using where -1 PRIMARY ta2 ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Warning 4219 Hint JOIN_PREFIX(`ta1`,`t2`,`t3`) is ignored as conflicting/duplicated -Warning 4219 Hint JOIN_SUFFIX(`t3`,`ta2`) is ignored as conflicting/duplicated -Note 1003 delete from `test`.`t1` `ta1` using `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta1`.`f1` = `test`.`t2`.`f1` and 1 and `test`.`t2`.`f1` is not null) where `test`.`t3`.`f1` = 9 DROP TABLE t1, t2, t3; # Const table behavior, table order is not changed, hint is applicable. # Note: Const tables are excluded from the process of dependency setting @@ -957,17 +483,7 @@ CREATE TABLE t2(f1 INT) ENGINE=InnoDB; INSERT INTO t2 VALUES (1); EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t1, t2) */ 1 FROM t1 JOIN t2 ON t1.f1 = t2.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t1`,`t2`) */ 1 AS `1` from `test`.`t2` where `test`.`t2`.`f1` = 1 EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2, t1) */ 1 FROM t1 JOIN t2 ON t1.f1 = t2.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) */ 1 AS `1` from `test`.`t2` where `test`.`t2`.`f1` = 1 DROP TABLE t1, t2; # # Bug#23144274 WL9158:ASSERTION `JOIN->BEST_READ < DOUBLE(1.79769313486231570815E+308L)' FAILED @@ -990,11 +506,6 @@ test.t2 analyze status OK EXPLAIN SELECT /*+ JOIN_SUFFIX(t1, t2) */ t2.f3 FROM t2 LEFT JOIN t1 ON t2.f1 = t1.f1 WHERE t1.f2 NOT LIKE ('FMGAU') OR t2.f2 > 't'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.f1 1 Using where -Warnings: -Warning 4219 Hint JOIN_SUFFIX(`t1`,`t2`) is ignored as conflicting/duplicated DROP TABLE t1, t2; CREATE TABLE t1 ( @@ -1025,23 +536,9 @@ EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t2, t3) JOIN_ORDER(t1, t2) */ t3.f1 FROM ( t2 INNER JOIN t3 ON t3.f2 = t2.f2 LEFT JOIN t1 ON t1.f1 = t3.f1 ) WHERE NOT (t2.f1 >= 7); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 range f2,f1 f1 5 NULL 1 100.00 Using index condition -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t1 ref f1 f1 5 test.t3.f1 1 100.00 Using where; Using index -Warnings: -Warning 4219 Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t2`,`t3`) */ `test`.`t3`.`f1` AS `f1` from `test`.`t2` join `test`.`t3` left join `test`.`t1` on(`test`.`t1`.`f1` = `test`.`t3`.`f1` and `test`.`t3`.`f1` is not null) where `test`.`t2`.`f1` < 7 and convert(`test`.`t3`.`f2` using utf8mb3) = `test`.`t2`.`f2` EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(t1, t2) JOIN_ORDER(t2, t3) */ t3.f1 FROM ( t2 INNER JOIN t3 ON t3.f2 = t2.f2 LEFT JOIN t1 ON t1.f1 = t3.f1 ) WHERE NOT (t2.f1 >= 7); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 -1 SIMPLE t1 ref f1 f1 5 test.t3.f1 1 100.00 Using where; Using index -1 SIMPLE t2 ref f2,f1 f2 768 func 1 100.00 Using index condition; Using where -Warnings: -Warning 4219 Hint JOIN_ORDER(`t2`,`t3`) is ignored as conflicting/duplicated -Note 1003 select /*+ JOIN_ORDER(@`select#1` `t1`,`t2`) */ `test`.`t3`.`f1` AS `f1` from `test`.`t2` join `test`.`t3` left join `test`.`t1` on(`test`.`t1`.`f1` = `test`.`t3`.`f1` and `test`.`t3`.`f1` is not null) where `test`.`t2`.`f1` < 7 and convert(`test`.`t3`.`f2` using utf8mb3) = `test`.`t2`.`f2` DROP TABLE t1, t2, t3; CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT, @@ -1053,12 +550,6 @@ PRIMARY KEY (f1) ); EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t1, t1) */ t2.f1 FROM t1 JOIN t2 ON t1.f2 = t2.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.f2 1 100.00 -Warnings: -Warning 4219 Hint JOIN_PREFIX(`t1`,`t1`) is ignored as conflicting/duplicated -Note 1003 select `test`.`t2`.`f1` AS `f1` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f2` DROP TABLE t1, t2; CREATE TABLE t1 ( @@ -1096,12 +587,6 @@ RIGHT OUTER JOIN t3 AS als4 ON (als1.f3 = als4.f2) SET als1.f4 = 'eogqjvbhzodzimqahyzlktkbexkhdwxwgifikhcgblhgswxyutepc' WHERE ('i','b') IN (SELECT f3, f1 FROM t2 WHERE f2 <> f2 AND als2.f2 IS NULL); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -Warnings: -Warning 4219 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated -Note 1276 Field or reference 'test.als2.f2' of SELECT #2 was resolved in SELECT #1 -Note 1003 update /*+ JOIN_ORDER(@`select#1` `t2`,`als1`,`als3`) */ (`test`.`t2`) join `test`.`t3` `als4` left join (`test`.`t3` `als1` join `test`.`t1` `als2` join `test`.`t1` `als3`) on(`test`.`als1`.`f3` = `test`.`als4`.`f2` and multiple equal(`test`.`als1`.`f1`, `test`.`als3`.`f3`) and multiple equal(`test`.`als1`.`f3`, `test`.`als2`.`f1`)) set `test`.`als1`.`f4` = 'eogqjvbhzodzimqahyzlktkbexkhdwxwgifikhcgblhgswxyutepc' where 0 DROP TABLE t1, t2, t3; CREATE TABLE t1( f1 VARCHAR(1)) ENGINE=myisam; @@ -1149,10 +634,6 @@ WHERE ( 'v', 'o' ) IN (SELECT DISTINCT t2.f1, t2.f2 FROM t4 RIGHT OUTER JOIN t2 ON (t4.f1 = t2.f1) WHERE t2.f3 BETWEEN '2001-10-04' AND '2003-05-15'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 update /*+ JOIN_ORDER(@`select#1` `t4`,`alias1`,`alias3`) */ `test`.`t1` semi join (`test`.`t2` left join `test`.`t4` on(`test`.`t4`.`f1` = `test`.`t2`.`f1` and `test`.`t2`.`f1` is not null)) left join (`test`.`t3` `alias1` join `test`.`t5` join `test`.`t3` `alias3`) on(`test`.`alias1`.`f3` = NULL and `test`.`t5`.`f1` = NULL and `test`.`alias3`.`f2` = `test`.`alias1`.`f2` and NULL is not null and `test`.`alias1`.`f2` is not null and NULL is not null) set `test`.`alias1`.`f1` = -1 where 0 DROP TABLE t1, t2, t3, t4, t5; CREATE TABLE t1 ( f1 INT(11) DEFAULT NULL, @@ -1180,11 +661,6 @@ t1 AS ta1 JOIN t1 AS ta2 ON ta1.f1 = ta2.f1 RIGHT JOIN t2 ON (ta1.f1 = t2.f1) SET ta1.f2 = '', ta2.f3 = '' WHERE ('n', 'r') IN (SELECT f2, f1 FROM t3 WHERE f1 <> f2 XOR ta2.f3 IS NULL); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1276 Field or reference 'test.ta2.f3' of SELECT #2 was resolved in SELECT #1 -Note 1003 update /*+ JOIN_SUFFIX(@`select#1` `ta1`,`t2`) */ `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1` `ta1` join `test`.`t1` `ta2`) on(`test`.`ta2`.`f1` = NULL and `test`.`ta1`.`f1` = NULL and NULL is not null and NULL is not null) set `test`.`ta1`.`f2` = '',`test`.`ta2`.`f3` = '' where 0 DROP TABLE t1, t2, t3; CREATE TABLE t2(f1 VARCHAR(255) DEFAULT NULL, f2 INT(11) DEFAULT NULL, KEY (f1), KEY (f2)) charset latin1 ENGINE=MyISAM; @@ -1224,11 +700,6 @@ ON alias5.f1 = alias8.f2 ON alias4.f2 = alias6.f1 JOIN t10 AS alias10 JOIN t11 AS alias11 ON alias10.f1 = alias11.f1 ON alias4.f2 = alias11.f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1105 Cannot use key `f2` part[0] for lookup: `test`.`t11`.`f2` of type `varchar` = "`alias4`.`f2`" of type `int` -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias11`,`alias8`) */ 1 AS `1` from `test`.`t4` `alias4` left join (`test`.`t5` `alias5` join `test`.`t6` `alias6` left join (`test`.`t7` `alias7` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias8`.`f1` = `test`.`alias7`.`f1` and `test`.`alias7`.`f1` is not null)) on(`test`.`alias5`.`f2` = NULL and `test`.`alias6`.`f1` = NULL and NULL is not null and `test`.`alias5`.`f2` is not null) join `test`.`t10` `alias10` join `test`.`t11` `alias11` where 0 EXPLAIN EXTENDED SELECT /*+ JOIN_ORDER(alias11, alias10, alias8, alias7) */ 1 FROM t4 AS alias4 @@ -1237,11 +708,6 @@ ON alias5.f1 = alias8.f2 ON alias4.f2 = alias6.f1 JOIN t10 AS alias10 JOIN t11 AS alias11 ON alias10.f1 = alias11.f1 ON alias4.f2 = alias11.f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1105 Cannot use key `f2` part[0] for lookup: `test`.`t11`.`f2` of type `varchar` = "`alias4`.`f2`" of type `int` -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias11`,`alias10`,`alias8`,`alias7`) */ 1 AS `1` from `test`.`t4` `alias4` left join (`test`.`t5` `alias5` join `test`.`t6` `alias6` left join (`test`.`t7` `alias7` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias7`.`f1` = `test`.`alias8`.`f1` and `test`.`alias5`.`f1` is not null and `test`.`alias8`.`f1` is not null)) on(`test`.`alias5`.`f2` = NULL and `test`.`alias6`.`f1` = NULL and NULL is not null and `test`.`alias5`.`f2` is not null) join `test`.`t10` `alias10` join `test`.`t11` `alias11` where 0 DROP TABLES t2, t4, t5, t6, t7, t10, t11; CREATE TABLE t1 (f1 VARCHAR(255) DEFAULT NULL, f2 VARCHAR(255) DEFAULT NULL, KEY (f1), KEY (f2)) ENGINE=InnoDB; @@ -1285,17 +751,6 @@ ON alias6.f1 = alias5.f1 ON alias5.f3 = alias7.f1 ON alias1.f2 = alias7.f1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE alias1 index NULL f2 1023 NULL 1 100.00 Using index -1 SIMPLE alias7 ALL NULL NULL NULL NULL 1 0.00 Using where -1 SIMPLE alias2 ref f2 f2 5 test.alias7.f1 1 100.00 Using where -1 SIMPLE alias4 ref f1 f1 5 test.alias2.f1 1 100.00 Using where -1 SIMPLE alias3 eq_ref PRIMARY PRIMARY 4 test.alias4.f2 1 100.00 -1 SIMPLE alias5 ref f3 f3 43 test.alias7.f1 1 100.00 Using where; Using index -1 SIMPLE alias8 ref f2 f2 5 test.alias5.f1 1 100.00 Using where; Using index -1 SIMPLE alias6 eq_ref PRIMARY PRIMARY 4 test.alias8.f2 1 100.00 Using where -Warnings: -Note 1003 select /*+ JOIN_ORDER(@`select#1` `alias8`,`alias6`) */ 1 AS `1` from `test`.`t1` `alias1` left join (`test`.`t7` `alias7` join `test`.`t2` `alias2` left join (`test`.`t3` `alias3` join `test`.`t4` `alias4`) on(`test`.`alias3`.`f1` = `test`.`alias4`.`f2` and `test`.`alias4`.`f1` = `test`.`alias2`.`f1` and `test`.`alias2`.`f1` is not null and `test`.`alias4`.`f2` is not null) join `test`.`t10` `alias5` left join (`test`.`t6` `alias6` join `test`.`t2` `alias8`) on(`test`.`alias8`.`f2` = `test`.`alias5`.`f1` and `test`.`alias6`.`f1` = `test`.`alias5`.`f1` and `test`.`alias5`.`f1` is not null and `test`.`alias8`.`f2` is not null)) on(`test`.`alias7`.`f1` = `test`.`alias1`.`f2` and `test`.`alias5`.`f3` = `test`.`alias1`.`f2` and `test`.`alias2`.`f2` = `test`.`alias7`.`f1` and `test`.`alias1`.`f2` is not null and `test`.`alias7`.`f1` is not null and `test`.`alias7`.`f1` is not null) where 1 DROP TABLES t1, t2, t3, t4, t6, t7, t10; # # Bug#23144230 WL#9158 : OPT_HINTS_QB::APPLY_JOIN_ORDER_HINTS - MYSQLD GOT SIGNAL 11 @@ -1324,12 +779,6 @@ FROM ( SELECT * FROM t1 ) AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias1.f2 = alias2.f3 WHERE alias2.f2 IS NULL HAVING (field1 != 3 AND field1 >= 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ref f2 f2 5 const 1 100.00 Using index condition; Using where -1 SIMPLE t1 ref f2 f2 5 test.t2.f3 1 100.00 Using index -Warnings: -Warning 4221 Unresolved table name `alias1` for JOIN_PREFIX hint -Note 1003 select `test`.`t2`.`f3` AS `field1` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`f2` = `test`.`t2`.`f3` and `test`.`t2`.`f2` is null having `f3` <> 3 and `f3` >= 8 DROP TABLE t1, t2; # # Bug#23651098 WL#9158 : ASSERTION `!(SJ_NEST->SJ_INNER_TABLES & JOIN->CONST_TABLE_MAP)' FAILED @@ -1357,10 +806,6 @@ test.t3 analyze status Table is already up to date EXPLAIN EXTENDED SELECT /*+ JOIN_PREFIX(t2, t1) */ t1.f1 FROM t1, t2 WHERE t2.f1 IN (SELECT t3.f1 FROM t3) AND t1.f1 = 183; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`,`t1`) */ NULL AS `f1` from `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` where 0 DROP TABLE t1, t2, t3; # # Bug23715779 SELECT QUERY WITH JOIN_PREFIX() HINT RETURNS INCORRECT RESULT @@ -1395,14 +840,6 @@ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND ta3.f2 IN (SELECT /*+ QB_NAME(qb2) */ f2 FROM t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 -1 PRIMARY t2 index f2 f2 5 NULL 3 100.00 Using where; Using index; LooseScan -1 PRIMARY ta3 ref f2 f2 5 test.t2.f2 1 33.33 Using index -1 PRIMARY ta4 index PRIMARY f2 5 NULL 3 100.00 Using index; Using join buffer (flat, BNL join) -1 PRIMARY t4 hash_ALL NULL #hash#$hj 5 test.ta4.f1 1 100.00 Using where; FirstMatch(ta4); Using join buffer (incremental, BNLH join) -Warnings: -Note 1003 select count(0) AS `COUNT(*)` from `test`.`t1` semi join (`test`.`t4`) semi join (`test`.`t2`) join `test`.`t2` `ta3` join `test`.`t2` `ta4` where `test`.`t4`.`f1` = `test`.`ta4`.`f1` and `test`.`ta3`.`f2` = `test`.`t2`.`f2` SELECT /*+ JOIN_PREFIX(t2@qb2, t4@qb1, ta3, ta4) */ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND @@ -1413,14 +850,6 @@ COUNT(*) FROM t1 JOIN t2 AS ta3 JOIN t2 AS ta4 WHERE ta4.f1 IN (SELECT /*+ QB_NAME(qb1) */ f1 FROM t4) AND ta3.f2 IN (SELECT /*+ QB_NAME(qb2) */ f2 FROM t2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index f2 f2 5 NULL 3 100.00 Using where; Using index; Start temporary -1 PRIMARY t4 ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join) -1 PRIMARY ta3 ref f2 f2 5 test.t2.f2 1 100.00 Using index -1 PRIMARY ta4 eq_ref PRIMARY PRIMARY 4 test.t4.f1 1 33.33 End temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select /*+ JOIN_PREFIX(@`select#1` `t2`@`qb2`,`t4`@`qb1`,`ta3`,`ta4`) */ count(0) AS `COUNT(*)` from `test`.`t1` semi join (`test`.`t4`) semi join (`test`.`t2`) join `test`.`t2` `ta3` join `test`.`t2` `ta4` where `test`.`ta4`.`f1` = `test`.`t4`.`f1` and `test`.`ta3`.`f2` = `test`.`t2`.`f2` DROP TABLE t1, t2, t4; MDEV-36638 Some optimizer hint warnings are returned as errors @@ -1446,22 +875,10 @@ INSERT INTO tn (fn_1, fn_2) SELECT /*+ JOIN_ORDER(t2,t1) JOIN_FIXED_ORDER() */ f1,f2 FROM t2 JOIN t1 ON t1.id=t2.id ORDER BY f1, f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using temporary; Using filesort -1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 33.33 Using where; Using join buffer (flat, BNL join) -Warnings: -Warning 4219 Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated -Note 1003 insert into `test`.`tn`(fn_1,fn_2) select /*+ JOIN_ORDER(@`select#1` `t2`,`t1`) */ `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` join `test`.`t1` where `test`.`t1`.`id` = `test`.`t2`.`id` order by `test`.`t1`.`f1`,`test`.`t2`.`f2` EXPLAIN EXTENDED INSERT INTO tn (fn_1, fn_2) SELECT /*+ JOIN_ORDER(t1,t2) */ f1,f2 FROM t2 LEFT JOIN t1 ON t1.id=t2.id ORDER BY f1, f2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 20 100.00 Using temporary; Using filesort -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 100.00 Using where -Warnings: -Warning 4219 Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated -Note 1003 insert into `test`.`tn`(fn_1,fn_2) select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`id` is not null) where 1 order by `test`.`t1`.`f1`,`test`.`t2`.`f2` DROP TABLE tn; DROP TABLE t1, t2; CREATE TABLE t1 (a int, b varchar(50), c varchar(50)); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_hints_join_order/' main.large_pages [ pass ] 20 main.flush_block_commit_notembedded [ pass ] 1209 main.drop_table_force [ pass ] 76 main.alter_table_online_debug 'binlog' [ pass ] 2613 main.innodb_mysql_lock2 [ pass ] 1051 main.alter_table_online 'binlog' [ pass ] 294 main.bug39022 [ pass ] 40 main.commit_1innodb [ pass ] 867 main.create_select [ pass ] 33 main.sp_trans [ pass ] 514 main.xa_binlog [ pass ] 38 main.partition_exchange [ pass ] 294 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.stat_tables_innodb [ fail ] Test ended at 2026-04-22 14:06:15 CURRENT_TEST: main.stat_tables_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.result 2026-04-02 14:38:09.473657332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.reject 2026-04-22 14:06:15.205654979 +0300 @@ -76,13 +76,6 @@ and o_orderdate < date '1995-01-01' + interval '1' year group by n_name order by revenue desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where -1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index -1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey @@ -207,13 +200,6 @@ and o_orderdate < date '1995-01-01' + interval '1' year group by n_name order by revenue desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where -1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where -1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index -1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey @@ -243,15 +229,6 @@ and p_type = 'STANDARD BRUSHED STEEL' ) as all_nations group by o_year order by o_year; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort -1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join) -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 5 dbt3_s001.part.p_partkey 30 Using index condition -1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.lineitem.l_suppkey 1 Using where -1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 -1 SIMPLE orders eq_ref PRIMARY,i_o_orderdate,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where -1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where -1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey i_n_regionkey 9 dbt3_s001.region.r_regionkey,dbt3_s001.customer.c_nationkey 1 Using index select o_year, sum(case when nation = 'UNITED STATES' then volume else 0 end) / sum(volume) as mkt_share @@ -282,13 +259,6 @@ and p_name like '%green%') as profit group by nation, o_year order by nation, o_year desc; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 -1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 -1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 Using where -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 -1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 EXPLAIN EXTENDED select nation, o_year, sum(amount) as sum_profit from (select n_name as nation, extract(year from o_orderdate) as o_year, @@ -300,15 +270,6 @@ and p_name like '%green%') as profit group by nation, o_year order by nation, o_year desc; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 100.00 Using where; Using index; Using temporary; Using filesort -1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 -1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 100.00 -1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 100.00 Using where -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 100.00 -1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 100.00 -Warnings: -Note 1003 select `dbt3_s001`.`nation`.`n_name` AS `nation`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) AS `o_year`,sum(`dbt3_s001`.`lineitem`.`l_extendedprice` * (1 - `dbt3_s001`.`lineitem`.`l_discount`) - `dbt3_s001`.`partsupp`.`ps_supplycost` * `dbt3_s001`.`lineitem`.`l_quantity`) AS `sum_profit` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`lineitem` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`orders` join `dbt3_s001`.`nation` where `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`orders`.`o_orderkey` = `dbt3_s001`.`lineitem`.`l_orderkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`part`.`p_name` like '%green%' group by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc order by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc select nation, o_year, sum(amount) as sum_profit from (select n_name as nation, extract(year from o_orderdate) as o_year, @@ -386,10 +347,6 @@ from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' and o_orderkey=l_orderkey and p_partkey=l_partkey; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE part range PRIMARY,i_p_retailprice i_p_retailprice 9 NULL 1 Using where; Using index -1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const 1 Using index -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity i_l_partkey 9 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey 1 Using index select o_orderkey, p_partkey from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' @@ -431,13 +388,9 @@ FLUSH TABLE t1; SET use_stat_tables='never'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 FLUSH TABLES; SET use_stat_tables='preferably'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # @@ -462,9 +415,6 @@ 1 AUS EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where ANALYZE TABLE t2; Table Op Msg_type Msg_text test.t2 analyze status Engine-independent statistics collected @@ -474,9 +424,6 @@ 1 AUS EXPLAIN SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where DROP TABLE t1,t2; # # MDEV-7370: Server deadlocks on renaming a table for which persistent statistics exists @@ -642,9 +589,6 @@ set @@use_stat_tables= PREFERABLY; explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 -1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL Using join buffer (flat, BNL join) set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; # @@ -973,31 +917,15 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connect con1, localhost, root,,; connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; update t1 set a= a +100; # Explain shows outdated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; analyze table t1 persistent for all; Table Op Msg_type Msg_text @@ -1005,16 +933,8 @@ test.t1 analyze status OK # Now explain shows updated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; # Run update and analyze in con1: update t1 set a= a - 150; @@ -1025,10 +945,6 @@ connection default; # Explain shows updated statistics: explain extended select count(*) from t1 where a < 50; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 disconnect con1; drop table t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.stat_tables_innodb/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.selectivity_innodb [ fail ] Test ended at 2026-04-22 14:06:25 CURRENT_TEST: main.selectivity_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.result 2026-04-02 14:38:09.454657383 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.reject 2026-04-22 14:06:25.020635463 +0300 @@ -33,16 +33,8 @@ flush table t1; explain extended select * from t1 where a is null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null explain extended select * from t1 where a is not null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 60.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null drop table t1; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP DATABASE IF EXISTS dbt3_s001; @@ -77,19 +69,6 @@ ) order by s_acctbal desc, n_name, s_name, p_partkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.63 Using where; Using join buffer (flat, BNL join) -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 -2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and (`dbt3_s001`.`part`.`p_size` = 9 or `dbt3_s001`.`part`.`p_size` = 19999) and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` set optimizer_use_condition_selectivity=4; explain extended select @@ -118,19 +97,6 @@ ) order by s_acctbal desc, n_name, s_name, p_partkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 2.08 Using where; Using join buffer (flat, BNL join) -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 -2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where -2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` === Q15 === create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) @@ -147,14 +113,6 @@ where s_suppkey = supplier_no and total_revenue = (select max(total_revenue) from revenue0) order by s_suppkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 -1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 1 100.00 Using where -3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -2 SUBQUERY ALL NULL NULL NULL NULL 10 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -168,14 +126,6 @@ where s_suppkey = supplier_no and total_revenue = (select max(total_revenue) from revenue0) order by s_suppkey; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 -1 PRIMARY ref key0 key0 5 dbt3_s001.supplier.s_suppkey 1 100.00 Using where -3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -2 SUBQUERY ALL NULL NULL NULL NULL 10 100.00 -4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no @@ -197,12 +147,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 100.00 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -241,12 +185,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 16.67 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -285,12 +223,6 @@ where s_comment like '%Customer%Complaints%') group by p_brand, p_type, p_size order by supplier_cnt desc, p_brand, p_type, p_size; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 16.67 Using where; Using temporary; Using filesort -1 PRIMARY partsupp ref PRIMARY,i_ps_partkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; Using index -2 MATERIALIZED supplier ALL PRIMARY NULL NULL NULL 10 100.00 Using where -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`part`.`p_brand` AS `p_brand`,`dbt3_s001`.`part`.`p_type` AS `p_type`,`dbt3_s001`.`part`.`p_size` AS `p_size`,count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) AS `supplier_cnt` from `dbt3_s001`.`partsupp` join `dbt3_s001`.`part` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`part`.`p_brand` <> 'Brand#11' and `dbt3_s001`.`part`.`p_type` not like 'SMALL POLISHED%' and `dbt3_s001`.`part`.`p_size` in (49,37,27,5,40,6,22,8) and !<`dbt3_s001`.`partsupp`.`ps_suppkey`>((`dbt3_s001`.`partsupp`.`ps_suppkey`,`dbt3_s001`.`partsupp`.`ps_suppkey` in ( (/* select#2 */ select `dbt3_s001`.`supplier`.`s_suppkey` from `dbt3_s001`.`supplier` where `dbt3_s001`.`supplier`.`s_comment` like '%Customer%Complaints%' ), (`dbt3_s001`.`partsupp`.`ps_suppkey` in on distinct_key where `dbt3_s001`.`partsupp`.`ps_suppkey` = ``.`s_suppkey`)))) group by `dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` order by count(distinct `dbt3_s001`.`partsupp`.`ps_suppkey`) desc,`dbt3_s001`.`part`.`p_brand`,`dbt3_s001`.`part`.`p_type`,`dbt3_s001`.`part`.`p_size` select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where p_partkey = ps_partkey @@ -330,14 +262,6 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort -1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index -2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -364,14 +288,6 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort -1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index -2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index -Warnings: -Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and ``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -403,13 +319,6 @@ ) as vip group by cntrycode order by cntrycode; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY customer ALL NULL NULL NULL NULL 150 100.00 Using where; Using temporary; Using filesort -4 DEPENDENT SUBQUERY orders ref i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 100.00 Using index -3 SUBQUERY customer ALL NULL NULL NULL NULL 150 100.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,<`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -444,13 +353,6 @@ ) as vip group by cntrycode order by cntrycode; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY customer ALL NULL NULL NULL NULL 150 100.00 Using where; Using temporary; Using filesort -4 DEPENDENT SUBQUERY orders ref i_o_custkey i_o_custkey 5 dbt3_s001.customer.c_custkey 15 100.00 Using index -3 SUBQUERY customer ALL NULL NULL NULL NULL 150 91.00 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.customer.c_custkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select substr(`dbt3_s001`.`customer`.`c_phone`,1,2) AS `cntrycode`,count(0) AS `numcust`,sum(`dbt3_s001`.`customer`.`c_acctbal`) AS `totacctbal` from `dbt3_s001`.`customer` where substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25') and `dbt3_s001`.`customer`.`c_acctbal` > (/* select#3 */ select avg(`dbt3_s001`.`customer`.`c_acctbal`) from `dbt3_s001`.`customer` where `dbt3_s001`.`customer`.`c_acctbal` > 0.00 and substr(`dbt3_s001`.`customer`.`c_phone`,1,2) in ('10','20','14','19','11','28','25')) and !(1,<`dbt3_s001`.`customer`.`c_custkey`>(exists(/* select#4 */ select 1 from `dbt3_s001`.`orders` where `dbt3_s001`.`orders`.`o_custkey` = `dbt3_s001`.`customer`.`c_custkey` limit 1))) group by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) order by substr(`dbt3_s001`.`customer`.`c_phone`,1,2) select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substr(c_phone, 1, 2) as cntrycode, c_acctbal @@ -490,17 +392,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY supplier ALL PRIMARY,i_s_nationkey NULL NULL NULL 10 100.00 Using where; Using filesort -1 PRIMARY nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 100.00 Using where -2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -544,16 +435,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 11.99 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -599,16 +480,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.03 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 7.11 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -654,16 +525,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -709,16 +570,6 @@ and n_name = 'UNITED STATES' order by s_name limit 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort -1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier) -4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where -Warnings: -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 -Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= (cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < (cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -759,11 +610,6 @@ (1,9), (6,3), (2,8), (4,1), (0,7), (4,8), (4,5); EXPLAIN EXTENDED SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -1 SIMPLE t2 ref idx idx 5 test.t1.b 1 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t1`.`b` SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d ); a b c d 0 7 0 7 @@ -781,19 +627,11 @@ set optimizer_use_condition_selectivity=1; explain extended select * from t1 where a < 1 and a > 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a set optimizer_use_condition_selectivity=3; explain extended select * from t1 where a < 1 and a > 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 1 and `test`.`t1`.`a` > 7 select * from t1 where a < 1 and a > 7; a drop table t1; @@ -803,11 +641,6 @@ insert into t2 values (2),(3); explain extended select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 3 select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); a drop table t1,t2; @@ -840,10 +673,6 @@ flush table t1; set optimizer_use_condition_selectivity=4; explain extended select * from t1 where a=0; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; set histogram_size=@save_histogram_size; set histogram_type=@save_histogram_type; @@ -875,19 +704,11 @@ set optimizer_use_condition_selectivity=1; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 DROP TABLE t1,t2; @@ -909,10 +730,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > 3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 75.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 SELECT * FROM t1 WHERE a > 3; a 9 @@ -941,11 +758,6 @@ set optimizer_switch='index_condition_pushdown=off'; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a > 9; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` > 9 SELECT * FROM t1, t2 WHERE a > 9; a b c set optimizer_switch=@save_optimizer_switch; @@ -990,13 +802,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 7 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 14 100.00 Using where; Using join buffer (flat, BNL join) -2 SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 -2 SUBQUERY t1 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((1,exists(/* select#2 */ select 1 from `test`.`t1` join `test`.`t2` limit 1))) and `test`.`t1`.`a` <> `test`.`t2`.`b` or `test`.`t1`.`a` <= 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; @@ -1016,28 +821,12 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 28.57 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NOT NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 71.43 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a IS NOT NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` is not null EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IS NULL OR a < 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 14 69.39 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is null or `test`.`t1`.`a` < 5 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; @@ -1143,10 +932,6 @@ count(*) 3 explain extended select * from t1 where a between 5 and 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 alter table t1 change column a a int; analyze table t1; Table Op Msg_type Msg_text @@ -1154,10 +939,6 @@ test.t1 analyze status OK flush table t1; explain extended select * from t1 where a between 5 and 7; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` between 5 and 7 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1; set use_stat_tables=@save_use_stat_tables; @@ -1187,10 +968,6 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 ); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`c3` = 'b')) where 0 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; # @@ -1252,12 +1029,6 @@ EXPLAIN EXTENDED SELECT * FROM language, country, continent WHERE country_group = lang_group AND lang_group IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE language ALL NULL NULL NULL NULL 6 16.67 Using where -1 SIMPLE country ALL NULL NULL NULL NULL 2 50.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE continent ALL NULL NULL NULL NULL 6 100.00 Using join buffer (incremental, BNL join) -Warnings: -Note 1003 select `test`.`language`.`lang_group` AS `lang_group`,`test`.`language`.`lang` AS `lang`,`test`.`country`.`code` AS `code`,`test`.`country`.`country_group` AS `country_group`,`test`.`continent`.`cont_group` AS `cont_group`,`test`.`continent`.`cont` AS `cont` from `test`.`language` join `test`.`country` join `test`.`continent` where `test`.`country`.`country_group` = `test`.`language`.`lang_group` and `test`.`language`.`lang_group` is null set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table language, country, continent; set use_stat_tables=@save_use_stat_tables; @@ -1300,12 +1071,6 @@ explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 100.00 Using where -1 SIMPLE t2 ref c,d c 5 test.t1.b 5 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`a` = `test`.`t2`.`d` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1317,12 +1082,6 @@ explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 262144 0.00 Using where -1 SIMPLE t2 ref c,d d 5 test.t3.a 7 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 262144 2.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t3` where `test`.`t1`.`b` = `test`.`t2`.`c` and `test`.`t2`.`d` = `test`.`t3`.`a` and `test`.`t3`.`b` < 5 and `test`.`t1`.`a` < 2000 select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b @@ -1346,11 +1105,6 @@ set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE c >= 0 OR a = b ; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 -Warnings: -Note 1003 select 'foo' AS `a`,'foo' AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 1 SELECT * FROM t1, t2 WHERE c >= 0 OR a = b ; a b c foo foo 1 @@ -1379,18 +1133,8 @@ test.t2 analyze status OK explain extended select * from t1 straight_join t2 where t1.a=t2.a and t1.a<10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 explain extended select * from t1 straight_join t2 where t1.a=t2.a and t2.a<10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` < 10 set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1412,11 +1156,6 @@ test.t2 analyze status OK explain extended select * from t2 a straight_join t2 b where a.a is null; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE a ALL NULL NULL NULL NULL 1000 100.00 Using where -1 SIMPLE b ALL NULL NULL NULL NULL 1000 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b` from `test`.`t2` `a` straight_join `test`.`t2` `b` where `test`.`a`.`a` is null set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; @@ -1440,11 +1179,6 @@ EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref PRIMARY,b b 5 const 1 100.00 Using where; Using index -1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` <> 'USARussian' and `test`.`t1`.`b` is null SELECT * FROM t1, t2 WHERE a <> 'USARussian' AND b IS NULL; a b i @@ -1464,10 +1198,6 @@ test.t1 analyze status OK explain extended select * from t1 where col1 > 'b' and col1 < 'e'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` > 'b' and `test`.`t1`.`col1` < 'e' select * from t1 where col1 > 'b' and col1 < 'e'; col1 c @@ -1499,27 +1229,15 @@ c explain extended select * from t1 where col1 > 'b' and col1 < 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 28.57 Using where -Warnings: -Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` > 'b' and `test`.`t1`.`col1` < 'd' select * from t2 where col1 > 'b' and col1 < 'd'; col1 c explain extended select * from t2 where col1 > 'b' and col1 < 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` > 'b' and `test`.`t2`.`col1` < 'd' select * from t2 where col1 < 'b' and col1 > 'd'; col1 explain extended select * from t2 where col1 < 'b' and col1 > 'd'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` < 'b' and `test`.`t2`.`col1` > 'd' drop table t1,t2; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; @@ -1552,12 +1270,6 @@ (11,11),(12,12),(13,13),(14,14),(15,15); set @@optimizer_use_condition_selectivity=2; explain extended select * from t1 where a in (select max(a) from t1 group by b); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where ``.`max(a)` = `test`.`t1`.`a` select * from t1 where a in (select max(a) from t1 group by b); a b 0 0 @@ -1578,12 +1290,6 @@ 15 15 set @@optimizer_use_condition_selectivity=1; explain extended select * from t1 where a in (select max(a) from t1 group by b); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where ``.`max(a)` = `test`.`t1`.`a` select * from t1 where a in (select max(a) from t1 group by b); a b 0 0 @@ -1662,22 +1368,10 @@ 62 # Check what info the optimizer has about selectivities explain extended select * from t1 use index () where a in (17,51,5); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 6.20 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5) explain extended select * from t1 use index () where b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 4.20 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2 # Now, the equality is used for ref access, while the range condition # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref|filter b,a b|a 5|5 const 42 (6%) 6.30 Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) truncate table t1; insert into t1 select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000; @@ -1692,10 +1386,6 @@ count(*) 29 explain extended select * from t1 where a in (17,51,5) and b=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; set use_stat_tables= @save_use_stat_tables; set @@histogram_size=@save_histogram_size; @@ -1738,8 +1428,6 @@ set @@optimizer_use_condition_selectivity=2; EXPLAIN SELECT * FROM City WHERE Country='FIN'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 7 Using index condition DROP DATABASE world; use test; CREATE TABLE t1 ( @@ -1770,8 +1458,6 @@ INSERT INTO t1 SELECT a + 1280, b, c FROM t1 LIMIT 80; EXPLAIN SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b,b_2 b 4 NULL 226 Using where SELECT a FROM t1 WHERE b = 1 ORDER BY c DESC LIMIT 9; a 2071 @@ -1799,12 +1485,6 @@ set optimizer_use_condition_selectivity=1; explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; b a a b @@ -1821,12 +1501,6 @@ set optimizer_use_condition_selectivity=2; explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; b a a b @@ -1846,12 +1520,6 @@ test.t1 analyze status OK explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 -Warnings: -Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100 set optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; drop table t1,t2,t3; # @@ -1929,10 +1597,6 @@ WHERE EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id WHERE A.a=t1.a AND t2.b < 20); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index -2 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index -2 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where set optimizer_switch= @save_optimizer_switch; drop table t1,t2; # @@ -1963,10 +1627,6 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN EXTENDED SELECT * from t1 where t1.a >= 81; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 66.67 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` >= 81 SELECT HEX(a), b from t1 where t1.a >= 81; HEX(a) b 51 81 @@ -1987,23 +1647,11 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 40.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 SET optimizer_use_condition_selectivity=3; # filtered should show 25 % EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; @@ -2020,9 +1668,6 @@ insert into t2 select seq,seq,seq from seq_1_to_100; set optimizer_use_condition_selectivity=2; EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE A const PRIMARY,a PRIMARY 4 const 1 -1 SIMPLE B ref a a 5 const 1 Using index set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; # @@ -2051,9 +1696,6 @@ create index t1_c2 on t1 (c2,c1); explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1 drop table t1; create table t1 (old_c1 integer, old_c2 integer, c1 integer, c2 integer, c3 integer) engine=aria; @@ -2074,9 +1716,6 @@ truncate table t1; insert into t1 select * from t2; explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1 drop trigger trg_t1; drop table t1,t2; create table t1 (old_c1 integer, old_c2 integer, c1 integer, @@ -2088,9 +1727,6 @@ truncate table t1; insert into t1 select * from t2; explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan -1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 2 drop table t1,t2; # # MDEV-31864 Assertion `d >= 0' failed in COST_ADD with join_cache_level @@ -2111,10 +1747,6 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1; a b c d e 1 NULL NULL NULL NULL @@ -2135,17 +1767,9 @@ # Must produce filtered=1% or so: explain extended select * from t1 where a like '%99%'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' # Must have same filtered as above explain extended select * from t1 where a like '%99%' and (b is null or b is not null); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` like '%99%' and (`test`.`t1`.`b` is null or `test`.`t1`.`b` is not null) drop table t1; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set use_stat_tables= @save_use_stat_tables; @@ -2253,10 +1877,6 @@ bar EXPLAIN EXTENDED SELECT * FROM t1 WHERE f1 < 'm'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 72.09 Using where -Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where `test`.`t1`.`f1` < 'm' CREATE TABLE t2 (f1 TEXT) ENGINE=InnoDB; INSERT INTO t2 VALUES ('foo'),('bar'),('qux'); ANALYZE TABLE t2; @@ -2270,10 +1890,6 @@ bar EXPLAIN EXTENDED SELECT * FROM t2 WHERE f1 <> 'qux'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where -Warnings: -Note 1003 select `test`.`t2`.`f1` AS `f1` from `test`.`t2` where `test`.`t2`.`f1` <> 'qux' DROP TABLE t1,t2; # # End of 10.0 tests @@ -2341,9 +1957,6 @@ TEXT46 TEXT,TEXT47 TEXT,TEXT48 TEXT,TEXT49 TEXT,TEXT50 TEXT ) ENGINE=InnoDB; EXPLAIN SELECT 1 FROM t1 NATURAL JOIN t1 AS t2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where -1 SIMPLE t2 hash_ALL NULL #hash#$hj 150 test.t1.TEXT1,test.t1.TEXT2,test.t1.TEXT3,test.t1.TEXT4,test.t1.TEXT5,test.t1.TEXT6,test.t1.TEXT7,test.t1.TEXT8,test.t1.TEXT9,test.t1.TEXT10,test.t1.TEXT11,test.t1.TEXT12,test.t1.TEXT13,test.t1.TEXT14,test.t1.TEXT15,test.t1.TEXT16,test.t1.TEXT17,test.t1.TEXT18,test.t1.TEXT19,test.t1.TEXT20,test.t1.TEXT21,test.t1.TEXT22,test.t1.TEXT23,test.t1.TEXT24,test.t1.TEXT25,test.t1.TEXT26,test.t1.TEXT27,test.t1.TEXT28,test.t1.TEXT29,test.t1.TEXT30,test.t1.TEXT31,test.t1.TEXT32,test.t1.TEXT33,test.t1.TEXT34,test.t1.TEXT35,test.t1.TEXT36,test.t1.TEXT37,test.t1.TEXT38,test.t1.TEXT39,test.t1.TEXT40,test.t1.TEXT41,test.t1.TEXT42,test.t1.TEXT43,test.t1.TEXT44,test.t1.TEXT45,test.t1.TEXT46,test.t1.TEXT47,test.t1.TEXT48,test.t1.TEXT49,test.t1.TEXT50 1 Using where; Using join buffer (flat, BNLH join) set join_cache_level=@tmp_jcl; drop table t1; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb/' main.alter_table_online_debug 'nobinlog' [ pass ] 2212 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.partition_explicit_prune [ fail ] Test ended at 2026-04-22 14:06:30 CURRENT_TEST: main.partition_explicit_prune --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.result 2026-04-17 18:40:40.465800292 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.reject 2026-04-22 14:06:29.540861540 +0300 @@ -452,30 +452,20 @@ EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (pNonexistent); ERROR HY000: Unknown partition 'pNonexistent' in table 't1' EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp2); -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0-9_subp2 index NULL b 71 NULL 2 Using index FLUSH STATUS; EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp2,pNeg) AS TableAlias; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE TableAlias pNeg_subp0,pNeg_subp1,p0-9_subp2 index NULL b 71 NULL 4 Using index SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_TMP_WRITE 24 +HANDLER_READ_KEY 6 +HANDLER_READ_RND_NEXT 2 +HANDLER_TMP_WRITE 25 # 8 locks (1 ha_partition + 3 ha_innobase) x 2 (lock/unlock) EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (subp3) AS TableAlias; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE TableAlias p0-9_subp3 index NULL b 71 NULL 3 Using index EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 PARTITION (`p10-99`); -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL b 71 NULL 2 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1000000; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (pNeg) WHERE a = 100; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # Test how it changes the alias/keywords/reserved words SELECT * FROM t1 PARTITION; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 @@ -578,7 +568,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -596,7 +586,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_ROLLBACK 1 @@ -612,7 +602,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_ROLLBACK 1 @@ -627,7 +617,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 4 HANDLER_DELETE 2 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 8 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 112 HANDLER_ROLLBACK 1 @@ -650,7 +640,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 140 HANDLER_ROLLBACK 1 @@ -670,7 +660,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 168 HANDLER_ROLLBACK 1 @@ -697,6 +687,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 4 +HANDLER_READ_KEY 6 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 # 1 commit @@ -774,7 +765,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 12 HANDLER_READ_RND_NEXT 2 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -793,7 +784,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 # 1 commit @@ -807,7 +798,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -822,6 +813,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -831,6 +823,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -875,7 +868,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 1 @@ -905,6 +898,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -913,6 +907,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -928,7 +923,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -942,7 +937,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -958,7 +953,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -988,7 +983,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 # 1 delete # 4 locks (pruning works!). @@ -1000,6 +995,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 +HANDLER_READ_KEY 6 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 1 delete @@ -1020,7 +1016,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 # + 3 read key (1 innodb_get_index in records_in_range @@ -1031,7 +1027,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -1044,7 +1040,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -1059,7 +1055,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1095,6 +1091,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 +HANDLER_READ_KEY 12 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 7 @@ -1107,7 +1104,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1216,6 +1213,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 15 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 12 locks (3 in t1, 1 in t3, 2 in t2) x 2 (lock + unlock) @@ -1233,7 +1231,7 @@ HANDLER_COMMIT 1 HANDLER_DELETE 6 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 17 HANDLER_READ_NEXT 2 HANDLER_READ_RND 4 HANDLER_READ_RND_NEXT 22 @@ -1613,17 +1611,9 @@ create table t1 (a int) partition by hash(a) partitions 3; insert into t1 values(1),(2),(3); explain partitions select * from t1 where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p1) where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p1) where a=1 or a=2; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p2) where a=1; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; # # Bug#59864: Crash if table empty: DELETE FROM t2 PARTITION (subp3). @@ -1935,8 +1925,6 @@ from seq_1_to_5000; explain select * from t1 partition (p1) where a=10 and b=10; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where flush tables; select * from t1 partition (p1)where a=10 and b=10; pk a b filler Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_explicit_prune/' main.partition_icp [ pass ] 714 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.partition_innodb2 [ fail ] Test ended at 2026-04-22 14:06:31 CURRENT_TEST: main.partition_innodb2 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_innodb2.result 2026-04-02 14:38:09.429657451 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_innodb2.reject 2026-04-22 14:06:31.230623089 +0300 @@ -17,8 +17,5 @@ mod(seq, 10), seq from seq_1_to_50; explain delete t1, t2 from t1, t2 where t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t2 ref a a 5 test.t1.a # delete t1, t2 from t1, t2 where t1.a=t2.a; drop table t1,t2; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_innodb2/' main.repair [ pass ] 1649 ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server main.multi_update [ fail ] Test ended at 2026-04-22 14:06:37 CURRENT_TEST: main.multi_update --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.result 2026-04-17 18:40:40.439798686 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.reject 2026-04-22 14:06:36.653612268 +0300 @@ -1066,9 +1066,6 @@ create table t2 (f int) engine=myisam; insert t2 values (1),(2); explain update t1, t2 set f = 126 order by f limit 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 update t1, t2 set f = 126 order by f limit 2; select * from t2; f @@ -1090,10 +1087,6 @@ 4 4 4 4 4 4 set optimizer_switch='firstmatch=off'; explain update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c< t2.c) order by t2.c, t1.c limit 10; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using where; Using temporary; Using filesort -1 PRIMARY t1 ref a a 5 test.t2.a 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c<=t2.c) order by t2.c, t1.c limit 5; select * from t2; a b c @@ -1122,10 +1115,6 @@ 0 1 0 0 2 0 explain update v1,t0 set c=1 where b=1 and x=c order by x,b limit 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t0 ALL NULL NULL NULL NULL 2 Using where update v1,t0 set c=1 where b<3 and x=c order by x,b limit 1; select * from v1; b c @@ -1179,94 +1168,10 @@ INSERT INTO t2 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2); # Expecting partition "Current" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=0 AND t1.part=0; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Current"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Current"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} # Expecting partition "Relevant" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=2 WHERE t2.part=1 AND t1.part=1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Relevant"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Relevant"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} # Expecting partition "Archive" EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=2 AND t1.part=2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "nested_loop": [ - { - "table": { - "table_name": "t2", - "partitions": ["Archive"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "partitions": ["Archive"], - "access_type": "system", - "possible_keys": ["PRIMARY"], - "rows": 1, - "filtered": 100 - } - } - ] - } -} DROP TABLES t1, t2; # End of 10.3 tests # @@ -1301,26 +1206,14 @@ where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using index condition; Using where; FirstMatch(t1); Using join buffer (flat, BNL join) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 explain delete from t1 using t1,t3 where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index explain update t1,t3 set t1.c1 = t1.c1+10 where t1.c2 = t3.c2 and t1.c1 > 1 and exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where -1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index create table t as select * from t1; select * from t1,t3 where t1.c2 = t3.c2 and @@ -1428,10 +1321,6 @@ 3 EXPLAIN UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt); SELECT * FROM t1; @@ -1493,10 +1382,6 @@ 3 EXPLAIN UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where UPDATE t1,t3 SET a = NULL WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); SELECT * FROM t1; @@ -1558,9 +1443,6 @@ 3 EXPLAIN UPDATE t1 SET a = NULL WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) UPDATE t1 SET a = NULL WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt); SELECT * FROM t1; @@ -1622,9 +1504,6 @@ 3 EXPLAIN UPDATE t1 SET a = NULL WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1) UPDATE t1 SET a = NULL WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte); SELECT * FROM t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.multi_update/' ReplayTest: Loading context ReplayTest: Failed to connect to replay server at socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock': 2002 Can't connect to local server through socket '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/' (111) ReplayTest: Failed to connect to replay server ^CStopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ gvim var/log/stdout.log psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ gvim /tmp/aa1.txt psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ mv /tmp/aa1.txt replay-server-run1.txt psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls -lah replay-server-run1.txt -rw-rw-r-- 1 psergey psergey 491K Apr 22 14:14 replay-server-run1.txt psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ gvim replay-server-run1.txt psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls asan.supp collections lib mariadb-stress-test.pl mtr mysql-test-run.pl README std_data var CMakeFiles dgcov.pl lsan.supp mariadb-test-run mtr.out-of-source out1 README-gcov suite cmake_install.cmake EXTRA_SERVER_QUICKSTART.txt main mariadb-test-run.pl mysql-stress-test.pl psergey-all-apr21.diff README.stress suite.pm CMakeLists.txt include Makefile mariadb-test-run.pl.orig mysql-test-run purify.supp replay-server-run1.txt valgrind.supp psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/ extra_server_1/ install.db/ log/ my.cnf mysqld.1/ plugins/ run/ std_data/ test.dmp tmp/ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/tmp/ check-mysqld_1.log check-mysqld_1.result mysqld.1/ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/ extra_server_1/ install.db/ log/ my.cnf mysqld.1/ plugins/ run/ std_data/ test.dmp tmp/ psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/extra_server_1/ data/ mysqld.pid mysqld.sock psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/log/opt opt_hints_join_order.log optimizer_costs2.log psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ls var/log/ Display all 164 possibilities? (y or n) psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ find var/ | grep -i replay var/log/replay_queries.log psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ vim var/log/replay_queries.log psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server main.stat_tables_innodb "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server main.stat_tables_innodb VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 899147 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_innodb [ fail ] Test ended at 2026-04-22 14:20:09 CURRENT_TEST: main.stat_tables_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.result 2026-04-02 14:38:09.473657332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.reject 2026-04-22 14:20:08.860239060 +0300 @@ -283,11 +283,11 @@ 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 EXPLAIN EXTENDED select nation, o_year, sum(amount) as sum_profit from (select n_name as nation, @@ -301,14 +301,12 @@ 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 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 +387,7 @@ 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_orderkey 4 Using where select o_orderkey, p_partkey from part, lineitem, orders where p_retailprice > 1100 and o_orderdate='1997-01-01' @@ -436,8 +434,6 @@ FLUSH TABLES; SET use_stat_tables='preferably'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # @@ -975,29 +971,21 @@ explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connect con1, localhost, root,,; connection con1; explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; update t1 set a= a +100; # Explain shows outdated statistics: explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 50.51 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection default; analyze table t1 persistent for all; Table Op Msg_type Msg_text @@ -1007,14 +995,10 @@ explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 1.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 connection con1; # Run update and analyze in con1: update t1 set a= a - 150; @@ -1027,8 +1011,6 @@ explain extended select count(*) from t1 where a < 50; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 100 100.00 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`a` < 50 disconnect con1; drop table t1; # Result length mismatch - 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/' -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 18 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.stat_tables_innodb 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server main.selectivity_innodb_notembedded "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server main.selectivity_innodb_notembedded VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 899436 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_innodb_notembedded [ fail ] Test ended at 2026-04-22 14:24:02 CURRENT_TEST: main.selectivity_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.reject 2026-04-22 14:24:02.023979987 +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/' -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 8 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.selectivity_innodb_notembedded 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server main.rowid_filter_innodb "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server main.rowid_filter_innodb VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 899527 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.rowid_filter_innodb 'normal' [ fail ] Test ended at 2026-04-22 14:24:42 CURRENT_TEST: main.rowid_filter_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.result 2026-04-17 18:40:40.482801343 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/rowid_filter_innodb.reject 2026-04-22 14:24:42.182781947 +0300 @@ -2435,8 +2435,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const # # 1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index -Warnings: -Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1 drop table t1, t2; # # MDEV-19820: use of rowid filter for innodb table without primary key @@ -2456,8 +2454,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2472,8 +2468,6 @@ explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter -Warnings: -Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; a b 30 2 @@ -2511,8 +2505,6 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a; a 1 @@ -2527,15 +2519,11 @@ SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update EXPLAIN EXTENDED SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter 1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update SET @saved_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,innodb_report_deadlock'; SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE; @@ -2587,9 +2575,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2610,9 +2595,6 @@ 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 10 100.00 Using where 3 MATERIALIZED t2 range PRIMARY,col_date_key,ch2,id2 ch2 4 NULL 2 100.00 Using where; Using index 3 MATERIALIZED bt1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t3.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` where (1,<`test`.`t3`.`id`>(exists(/* select#2 */ select 1 from `test`.`t1` where <`test`.`t3`.`id`>((`test`.`t3`.`id`,`test`.`t3`.`id` in ( (/* select#3 */ select `test`.`bt1`.`id` from `test`.`t2` join `test`.`t1` `bt1` where `test`.`bt1`.`ch` = `test`.`t2`.`ch2` and `test`.`bt1`.`id` = `test`.`t2`.`pk` and `test`.`t2`.`ch2` <= 'g' ), (`test`.`t3`.`id` in on distinct_key where `test`.`t3`.`id` = ``.`id`)))) or `test`.`t1`.`id2` = `test`.`t1`.`id` limit 1))) SELECT 1 FROM t3 WHERE EXISTS ( SELECT 1 FROM t1 WHERE t3.id IN ( SELECT bt1.id FROM t2, t1 AS bt1 @@ -2650,8 +2632,6 @@ where id=15066 and (match s against ('+"fttest"' in boolean mode)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 fulltext id,s s 0 1 1.64 Using where -Warnings: -Note 1003 select count(0) AS `count(0)` from `test`.`t1` where `test`.`t1`.`id` = 15066 and (match `test`.`t1`.`s` against ('+"fttest"' in boolean mode)) select count(0) from t1 where id=15066 and (match s against ('+"fttest"' in boolean mode)); count(0) @@ -2963,8 +2943,6 @@ ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; DROP TABLE t1; # @@ -3002,16 +2980,12 @@ WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range|filter a,b b|a 5|5 NULL 192 (21%) 21.31 Using index condition; Using where; Using rowid filter -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where -Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) @@ -3554,9 +3528,6 @@ 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where 2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<`test`.`t1`.`c1`,`test`.`t1`.`pk`>((`test`.`t1`.`c1`,(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond((`test`.`t1`.`c1`) = `test`.`t2`.`c1`)))) SELECT * FROM t1 WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.rowid_filter_innodb-normal/' Only 1 of 2 completed. -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 14 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.rowid_filter_innodb 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server main.selectivity_innodb_notembedded "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server main.selectivity_innodb_notembedded VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 899637 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_innodb_notembedded [ fail ] Test ended at 2026-04-22 14:25:43 CURRENT_TEST: main.selectivity_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.reject 2026-04-22 14:25:42.813491333 +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/' -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 7 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.selectivity_innodb_notembedded 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server main.costs "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server main.costs VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 899808 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.costs [ fail ] Test ended at 2026-04-22 14:26:33 CURRENT_TEST: main.costs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.result 2026-04-17 18:40:40.367794237 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.reject 2026-04-22 14:26:33.236256591 +0300 @@ -7,87 +7,87 @@ explain select sum(e) as "table_scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 -Last_query_cost 0.012556 +Last_query_cost 0.024323 explain select sum(a) as "index scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Range scans should be used if we don't examine all rows in the table # explain select count(a) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Last_query_cost 0.000000 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index -Last_query_cost 0.002747 +Last_query_cost 0.024323 # # Shorter indexes are preferred over longer indexes # explain select sum(a+b) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL ba 9 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 explain select count(*) from t1 where b between 5 and 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index -Last_query_cost 0.002097 +Last_query_cost 0.024323 explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' explain select count(*) from t1 where b > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 explain select count(*) from t1 where d > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 # # Check covering index usage # explain select a,b,c from t1 where a=b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Prefer ref keys over ranges # explain select count(*) from t1 where b=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=2 and c=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda,cba,cb cba 10 const,const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=3 and c between 3 and 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # # Prefer eq keys over ref keys # explain select a,b,e from t1 where a=10 or a=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition -Last_query_cost 0.003126 +Last_query_cost 0.024323 explain select a,b,e from t1 where d=10 or d=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 2 Using index condition -Last_query_cost 0.003291 +Last_query_cost 0.024323 drop table t1; # # MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in @@ -120,8 +120,6 @@ KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) ) ENGINE= InnoDB; explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range l_suppkey l_suppkey 10 NULL 1 Using where; Using index drop table t1; set global InnoDB.optimizer_disk_read_ratio=@save; # @@ -153,48 +151,5 @@ b >= date '1993-06-01' and b < date '1993-06-01' + interval '3' month and exists (select * from t2 where e = t1.a and g < h) group by c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 12.53886553, - "filesort": { - "sort_key": "t1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["PRIMARY", "t1_ix1"], - "loops": 1, - "rows": 7000, - "cost": 1.1518548, - "filtered": 100, - "attached_condition": "t1.b >= DATE'1993-06-01' and t1.b < (DATE'1993-06-01' + interval '3' month)" - } - }, - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["e"], - "ref": ["test.t1.a"], - "loops": 7000, - "rows": 1, - "cost": 6.7528092, - "filtered": 100, - "attached_condition": "t2.g < t2.h", - "first_match": "t1" - } - } - ] - } - } - } -} set max_heap_table_size=@save_mhts; drop table t1, t2; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 13 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.costs 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server-manual main.costs "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server-manual main.costs VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch Collecting tests... Installing system database... Starting replay server in manual mode... 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... ====================================================================== REPLAY SERVER MANUAL MODE ====================================================================== Please start the replay server with the following 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 Or run under gdb: gdb --args /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 Waiting for socket file to appear: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock (Timeout: 300 seconds) ====================================================================== Still waiting for socket... (10 seconds elapsed) Still waiting for socket... (20 seconds elapsed) Still waiting for socket... (30 seconds elapsed) Still waiting for socket... (40 seconds elapsed) Still waiting for socket... (50 seconds elapsed) Still waiting for socket... (60 seconds elapsed) Still waiting for socket... (70 seconds elapsed) Still waiting for socket... (80 seconds elapsed) Socket file detected: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Replay server detected with PID: 900108 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Replay server is ready! ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context worker[01] Trying to dump core for [mysqltest - pid: 900143, winpid: 900143] worker[01] Trying to dump core for [mysqld.1 - pid: 900127, winpid: 900127] main.costs [ fail ] timeout after 900 seconds Test ended at 2026-04-22 14:45:21 Test case timeout after 900 seconds == /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/costs.log == `l_extra` int(11) NOT NULL, `l_quantity` double DEFAULT NULL, `l_extendedprice` double DEFAULT NULL, `l_discount` double DEFAULT NULL, `l_tax` double DEFAULT NULL, `l_returnflag` char(1) DEFAULT NULL, `l_linestatus` char(1) DEFAULT NULL, `l_shipDATE` date DEFAULT NULL, `l_commitDATE` date DEFAULT NULL, `l_receiptDATE` date DEFAULT NULL, `l_shipinstruct` char(25) DEFAULT NULL, `l_shipmode` char(10) DEFAULT NULL, `l_comment` varchar(44) DEFAULT NULL, PRIMARY KEY (`l_orderkey`), UNIQUE (`l_linenumber`), UNIQUE (`l_extra`) , KEY `l_suppkey` (l_suppkey, l_partkey), 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; == /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) - 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/' -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.000 of 1046 seconds executing testcases Failure: Failed 1/1 tests, 0.00% were successful. Failing test(s): main.costs 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 mysql-test-run: *** ERROR: there were failing test cases Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git citool ^Z [1]+ Stopped git citool psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git log commit 47cd2ab74dc8c94ac2722ea925966d1c4f2df3e0 (HEAD -> bb-12.3-MDEV-39368-test-replay) Author: Sergei Petrunia Date: Wed Apr 22 14:55:12 2026 +0300 Remove garbage comment commit d04f00eb9c097d5ecc373c47927d9e486ff18985 (origin/bb-12.3-MDEV-39368-test-replay) Author: Sergei Petrunia Date: Tue Apr 21 13:49:37 2026 +0300 Enable replay for any EXPLAIN query, do not require "FORMAT=JSON". commit 5aade5ddda26ab971cef8a1f7850c12386030da8 Author: Sergei Petrunia Date: Tue Apr 21 13:40:51 2026 +0300 Temporarily? disable assert for DBUG_ASSERT(*freq > 0) in infuse_table_stats commit 77a0b7c87bf431000ea7beb77da40a35e692fe00 Author: Sergei Petrunia Date: Mon Apr 20 18:09:10 2026 +0300 Let the optimizer context have DROP TABLE|VIEW IF EXISTS. This is needed to be able to run replay for many queries in a row. Need to discuss whether we should ship it like this. commit be91278eaa2c2c3d80bcd6e48806d41fe261e7db Author: Sergei Petrunia Date: Mon Apr 20 18:08:13 2026 +0300 Kill replay server when mtr exits, in various cases. commit cdb786da85b753d68ce792aafddeea92c86dbbf4 Author: Sergei Petrunia Date: Mon Apr 20 18:06:58 2026 +0300 Don't display result column name twice. commit 97ece2bc81d94d5166135c6b8515816b2702e6b2 Author: Sergei Petrunia Date: Mon Apr 20 15:13:02 2026 +0300 MDEV-39368: Run set optimizer_replay_context='' for cleanup. commit 7ff88d8c30e6ddb4b483cc3233fe872790e5e28c Author: Sergei Petrunia Date: Mon Apr 20 13:08:45 2026 +0300 psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ bg [1]+ git citool & psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server rowid_filter_innod "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server rowid_filter_innod VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch Collecting tests... mysql-test-run: *** ERROR: Could not find 'rowid_filter_innod' in 'main-,archive-,atomic-,binlog-,binlog_encryption-,binlog_in_engine-,client-,csv-,compat/oracle-,compat/mssql-,compat/maxdb-,encryption-,events-,federated-,funcs_1-,funcs_2-,gcol-,handler-,heap-,innodb-,innodb_fts-,innodb_gis-,innodb_i_s-,innodb_zip-,json-,maria-,mariabackup-,merge-,multi_source-,optimizer_unfixed_bugs-,parts-,perfschema-,plugins-,roles-,rpl-,stress-,sys_vars-,sql_sequence-,unit-,vcol-,versioning-,period-,sysschema-,connect,sequence,spider,spider/bg,spider/bugfix,spider/regression/e1121,spider/regression/e112122,spider/feature,sql_discovery,mysql_sha2,disks,func_test,metadata_lock_info,query_response_time,type_assoc_array,type_cursor,type_inet,type_mysql_timestamp,type_test,type_uuid,user_variables' suite(s) [1]+ Done git citool psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mtr --replay-server rowid_filter_innodb "our" variable $opt_replay_server redeclared at ./mtr line 298. "our" variable $opt_replay_server_manual redeclared at ./mtr line 299. Logging: ./mtr --replay-server rowid_filter_innodb VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch 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 904305 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 7765 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 7946 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 15.711 of 22 seconds executing testcases Completed: All 2 tests were successful. Stopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git branch 11.8 bb-11.8-mdev-39251-records-in-range bb-12.3-MDEV-38805-dev-sprint-work-2 * bb-12.3-MDEV-39368-test-replay psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git branch 11.8 bb-11.8-mdev-39251-records-in-range bb-12.3-MDEV-38805-dev-sprint-work-2 * bb-12.3-MDEV-39368-test-replay psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git status On branch bb-12.3-MDEV-39368-test-replay Your branch is ahead of 'origin/bb-12.3-MDEV-39368-test-replay' by 1 commit. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: mariadb-test-run.pl Untracked files: (use "git add ..." to include in what will be committed) main/a1.result main/a1.test main/b1.test mariadb-test-run.pl.orig out1 psergey-all-apr21.diff replay-server-run1.txt ../psergey-tmp.diff ../replay-server-part1.diff ../replay-server-testing.diff ../vibe-code2.diff no changes added to commit (use "git add" and/or "git commit -a") psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ git branch^C psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$ ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force Statement unlikely to be reached at ./mysql-test-run line 3164. (Maybe you meant system() when you said exec()?) Logging: ./mysql-test-run --suite=main --big --replay-server --max-test-fail=50000 --force VS config: vardir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var Checking leftover processes... Removing old var directory... Creating var directory '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var'... Checking supported features... MariaDB Version 12.3.0-MariaDB-debug - SSL connections supported - binaries are debug compiled Using suites: main Collecting tests... Installing system database... Starting replay server... Copying /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/install.db to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data... Starting mysqld on port 10011 with socket /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock... Command: /home/psergey/dev-git/11.8-skip-records-in-range/sql/mariadbd --no-defaults --datadir=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data --port=10011 --socket=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock --pid-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.pid --log-error=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.err --general-log=1 --general-log-file=/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log --skip-networking=0 --skip-grant-tables --key-buffer-size=1M --sort-buffer-size=256K --max-heap-table-size=1M Server process started with PID 923086 Waiting for server to be ready... Socket file created: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Extra server 1 started successfully Connection info written to /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/extra_server_1.info Host: 127.0.0.1 Port: 10011 Socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock Datadir: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/data General log: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.log Replay server started on socket: /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/extra_server_1/mysqld.sock ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029 main.max_statement_time [ disabled ] cannot possibly work, depends on timing main.mysql_embedded [ disabled ] Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 main.partition_open_files_limit [ disabled ] open_files_limit check broken by MDEV-18360 main.read_many_rows_innodb [ disabled ] Bug#11748886 2010-11-15 mattiasj report already exists main.tablespace [ disabled ] disabled in MariaDB (no TABLESPACE table attribute) main.mysql_install_db_win_admin [ skipped ] Requires admin privileges main.charset_client_win [ skipped ] Not tested with utf8 command line support main.mariadb-upgrade-service [ skipped ] Requires admin privileges main.openssl_6975 [ skipped ] no or wrong openssl version main.winservice_basic [ skipped ] Requires admin privileges main.winservice_i18n [ skipped ] Requires admin privileges main.connect-abstract [ pass ] 1 main.connect [ pass ] 14435 main.connect2 [ pass ] 34 main.join_cache_notasan [ pass ] 48 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.pool_of_threads [ fail ] Test ended at 2026-04-22 15:47:32 CURRENT_TEST: main.pool_of_threads --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.result 2026-04-02 14:38:09.434657437 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/pool_of_threads.reject 2026-04-22 15:47:31.826590163 +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 ] 80 main.ssl_encrypted_key 'file' [ pass ] 86 main.ssl_encrypted_key 'pass' [ pass ] 106 main.optimizer_costs2 [ pass ] 1 main.ipv4_and_ipv6 [ pass ] 529 main.ipv4_as_ipv6 [ pass ] 1188 main.ipv6 [ pass ] 585 main.bind_multiple_addresses_resolution [ pass ] 27 main.bind_address_resolution [ pass ] 37 main.sp_trans_log [ pass ] 115 main.tc_heuristic_recover [ pass ] 2952 main.merge_alter [ pass ] 127 main.mysqlbinlog_row_minimal [ pass ] 187 main.long_unique_bugs [ pass ] 492 main.tmp_space_usage [ pass ] 15117 main.stat_tables_rbr [ pass ] 97 main.ctype_cp932_binlog_row [ pass ] 138 main.mysqlbinlog_row_compressed [ pass ] 126 main.invisible_partition [ pass ] 25 main.mysqlbinlog-innodb [ pass ] 53 main.partition_innodb_stmt [ pass ] 43 main.session_tracker_sysvar [ pass ] 13 main.tmp_table_binlog [ pass ] 19 main.mysqlbinlog [ pass ] 1356 main.mysqlbinlog_stmt_compressed [ pass ] 105 main.set_statement_notembedded_binlog [ pass ] 21 main.partition_binlog_stmt [ pass ] 31 main.backup_lock_binlog [ pass ] 2013 main.lock_tables_lost_commit [ pass ] 15 main.ctype_collate_implicit_def [ pass ] 58 main.ctype_filesystem [ pass ] 5 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ps [ fail ] Test ended at 2026-04-22 15:48:30 CURRENT_TEST: main.ps /home/psergey/dev-git/11.8-skip-records-in-range/client//mariadb-test: Error on delete of '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/tmp/f1.txt' (Errcode: 2 "No such file or directory") --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.result 2026-04-17 18:40:40.470800601 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ps.reject 2026-04-22 15:48:30.054799925 +0300 @@ -2146,8 +2146,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2157,8 +2160,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2168,8 +2174,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 call proc_1(); show open tables from mysql; @@ -2179,8 +2188,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; create function func_1() returns int begin flush tables; return 1; end| @@ -2195,8 +2207,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 prepare abc from "flush tables"; execute abc; @@ -2207,8 +2222,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2218,8 +2236,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 execute abc; show open tables from mysql; @@ -2229,8 +2250,11 @@ Host User show open tables from mysql; Database Table In_use Name_locked +mysql column_stats 0 0 mysql general_log 0 0 mysql global_priv 0 0 +mysql index_stats 0 0 +mysql table_stats 0 0 mysql user 0 0 flush tables; deallocate prepare abc; @@ -3963,7 +3987,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3978,7 +4002,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -3993,7 +4017,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 3 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4008,7 +4032,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -4163,7 +4187,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -4178,7 +4202,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -5505,8 +5529,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 ] 1796 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_varchar [ fail ] Test ended at 2026-04-22 15:48:34 CURRENT_TEST: main.type_varchar --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.result 2026-04-17 18:40:40.524803938 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_varchar.reject 2026-04-22 15:48:34.476258112 +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 ] 129 main.ctype_ucs2_query_cache [ pass ] 32 main.ctype_ucs2_def [ pass ] 42 main.ctype_utf16_def [ pass ] 28 main.ctype_utf32_def [ pass ] 24 main.lowercase_utf8 [ pass ] 5 main.bug47671 [ pass ] 49 main.ctype_utf8_def_upgrade [ pass ] 39 main.mysql_upgrade-34014 [ pass ] 1128 main.ctype_utf8mb4_unicode_ci_def [ pass ] 30 main.ctype_ldml [ pass ] 272 main.grant [ pass ] 575 main.grant2 [ pass ] 170 main.grant4 [ pass ] 80 main.mysqldump [ pass ] 49153 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8mb4_innodb [ fail ] Test ended at 2026-04-22 15:49:36 CURRENT_TEST: main.ctype_utf8mb4_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.result 2026-04-02 14:38:09.327657727 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4_innodb.reject 2026-04-22 15:49:35.714200498 +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 ] 861 main.lock_sync [ pass ] 498 main.partition_innodb_semi_consistent [ pass ] 10129 main.mdl_sync [ pass ] 1960 main.crash_commit_before [ pass ] 365 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_utf8 [ fail ] Test ended at 2026-04-22 15:49:58 CURRENT_TEST: main.ctype_utf8 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.result 2026-04-02 14:38:09.324657735 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8.reject 2026-04-22 15:49:57.945130764 +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 @@ -5291,17 +5295,9 @@ # # as in the bug report. EXPLAIN output should still be pretty readable SET NAMES latin1; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ' AS u; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcd�\0081ÂÃÄÅ' AS `abcd�\0081ÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcd�\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` # Test normal utf8 SET NAMES utf8; EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃ\0081ÂÃÄÅ`,_utf8mb3'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ` # # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT # @@ -5352,7 +5348,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 +5369,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 +5423,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 +5448,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 +5479,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 +5581,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 +5602,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 +5656,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 +5681,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 +5712,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 +5814,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 +5835,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-22 15:49:59 CURRENT_TEST: main.ctype_utf8mb4 --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.result 2026-04-02 14:38:09.325657732 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/ctype_utf8mb4.reject 2026-04-22 15:49:59.243787540 +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 ] 290 main.ps_3innodb [ pass ] 356 main.strict [ pass ] 97 main.bootstrap [ pass ] 10176 main.multidelete_engine 'aria' [ pass ] 35 main.spatial_utility_function_collect 'aria' [ pass ] 26 main.vector 'aria' [ pass ] 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 main.mdev-34413-icp-reverse-order 'innodb' [ pass ] 617 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'innodb' [ pass ] 139 main.multidelete_engine 'innodb' [ pass ] 18 main.spatial_utility_function_collect 'innodb' [ pass ] 50 main.vector 'innodb' [ pass ] 663 main.multidelete_engine 'heap' [ pass ] 16 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 281 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.mdev-36094-rowid-filter-reverse-scan 'myisam' [ pass ] 82 main.multidelete_engine 'myisam' [ pass ] 8 main.spatial_utility_function_collect 'myisam' [ pass ] 30 main.vector 'myisam' [ pass ] 178 main.userstat [ pass ] 1104 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.group_min_max 'debug' [ fail ] Test ended at 2026-04-22 15:50:33 CURRENT_TEST: main.group_min_max --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.result 2026-04-17 18:40:40.421797574 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/group_min_max.reject 2026-04-22 15:50:32.659181164 +0300 @@ -2412,7 +2412,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 EXPLAIN SELECT max(b), a FROM t1 GROUP BY a; @@ -2434,7 +2434,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 13 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -2447,7 +2447,7 @@ 6 4 SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 16 +Handler_read_key 21 Handler_read_next 0 Handler_read_retry 0 EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION @@ -2464,7 +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; @@ -2500,7 +2499,7 @@ INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 13 +Handler_read_key 23 Handler_read_next 0 Handler_read_retry 0 DELETE FROM t3; @@ -2509,14 +2508,14 @@ FROM t1 LIMIT 1; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; DELETE FROM t3 WHERE (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) > 10000; SHOW STATUS LIKE 'handler_read__e%'; Variable_name Value -Handler_read_key 8 +Handler_read_key 18 Handler_read_next 0 Handler_read_retry 0 FLUSH STATUS; @@ -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 failed on replay server: 1364 Field 'c' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain [ fail ] Test ended at 2026-04-22 15:50:40 CURRENT_TEST: main.show_explain --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.result 2026-04-17 18:40:40.488801714 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/show_explain.reject 2026-04-22 15:50:39.690999943 +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 ] 121 main.enforce_storage_engine_opt [ pass ] 30 main.log_state_bug33693 [ pass ] 1 main.log_tables-big [ pass ] 163021 main.mysql_client_test [ pass ] 36485 main.mysql_client_test_nonblock [ pass ] 36373 main.log_tables [ pass ] 15234 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_mat_cost [ fail ] Test ended at 2026-04-22 15:55:00 CURRENT_TEST: main.subselect_mat_cost --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.result 2026-04-02 14:38:09.484657302 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/subselect_mat_cost.reject 2026-04-22 15:55:00.576179406 +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 ] 16505 main.create_or_replace [ pass ] 258 main.mysql_upgrade-6984 [ pass ] 2558 main.innodb_load_xa [ skipped ] Need InnoDB plugin main.innodb_ignore_builtin [ pass ] 2 main.init_file [ pass ] 4 main.init_file_longline_3816 [ pass ] 27 ReplayTest: Loading context main.init_connection_query_cache [ pass ] 62 main.init_connect [ pass ] 111 main.ctype_utf8mb4_0900_mem [ pass ] 64 main.delayed_blob [ pass ] 25 main.mysql_upgrade [ skipped ] cannot test minor upgrade for previews ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.join_cache [ fail ] Test ended at 2026-04-22 15:55:48 CURRENT_TEST: main.join_cache --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.result 2026-04-17 18:40:40.431798192 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/join_cache.reject 2026-04-22 15:55:48.180002771 +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(*) @@ -6114,8 +6147,6 @@ # - table db accessed with hash_ALL: explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.db WHERE Select_priv = PAGE_FAULTS_MINOR; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set join_cache_level=@save_join_cache_level; create table t1 (c1 date not null, key (c1)) engine=innodb; insert t1 values ('2017-12-27'); Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.join_cache/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.statistics_json [ fail ] Test ended at 2026-04-22 15:55:53 CURRENT_TEST: main.statistics_json --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.result 2026-04-17 18:40:40.504802702 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/statistics_json.reject 2026-04-22 15:55:52.728260304 +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-22 15:55:50 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 15:55:50 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 15:55:50 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 15:55:50 4 [ERROR] Column count of mysql.table_stats is wrong. Expected 3, found 1. The table is probably corrupted 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1. 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: histogram_hb must contain an array at offset 32. 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 32. 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: "start" element not present at offset 42. 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: String or number expected at offset 27. 2026-04-22 15:55:51 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 57. 2026-04-22 15:55:52 4 [ERROR] Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 45. 2026-04-22 15:55:52 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 ] 2867 main.analyze_stmt_prefetch_count [ pass ] 2577 main.host_cache_size_functionality [ pass ] 1431 main.long_unique_innodb [ pass ] 8195 main.insert_debug [ pass ] 46 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'off,unoptimized' [ fail ] Test ended at 2026-04-22 15:56:21 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 15:56:20.559928971 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-off,unoptimized/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'on,unoptimized' [ fail ] Test ended at 2026-04-22 15:56:25 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.result~ 2026-04-22 14:04:55.222812122 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,on,unoptimized.reject 2026-04-22 15:56:25.480913577 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -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), @@ -295,7 +298,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +464,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +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 ] 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 main.innodb_ext_key 'covering,off' [ fail ] Test ended at 2026-04-22 15:56:31 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.result~ 2026-04-22 14:04:50.673820951 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,off.reject 2026-04-22 15:56:31.362895179 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 21 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -209,7 +209,7 @@ where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 30 Handler_read_last 0 Handler_read_next 294 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 31 Handler_read_last 0 Handler_read_next 1230 Handler_read_prev 0 @@ -295,7 +295,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 45 Handler_read_last 0 Handler_read_next 26 Handler_read_prev 0 @@ -461,7 +461,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.innodb_ext_key-covering,off/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.innodb_ext_key 'covering,on' [ fail ] Test ended at 2026-04-22 15:56:36 CURRENT_TEST: main.innodb_ext_key --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.result~ 2026-04-22 14:05:05.574267786 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/innodb_ext_key,covering,on.reject 2026-04-22 15:56:36.275879813 +0300 @@ -17,7 +17,7 @@ show /*1*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -38,7 +38,7 @@ show /*2*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -59,7 +59,7 @@ show /*3*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -82,7 +82,7 @@ show /*4*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -93,7 +93,7 @@ explain select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01'; min(l_orderkey) @@ -101,7 +101,7 @@ show /*5*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -113,7 +113,7 @@ select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select min(l_orderkey) from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000; @@ -122,7 +122,7 @@ show /*6*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -134,7 +134,7 @@ select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -143,7 +143,7 @@ show /*7*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 44 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -169,7 +169,7 @@ show /*8*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -196,7 +196,7 @@ show /*9*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -243,7 +243,7 @@ show /*b*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 64 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -265,7 +265,7 @@ show /*c*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 49 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -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), @@ -295,7 +298,7 @@ show /*d*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 3 +Handler_read_key 50 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -461,7 +464,7 @@ show /*e*/ status like 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 18 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -495,7 +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 ] 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 main.rowid_filter_innodb 'normal' [ pass ] 7950 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 8179 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_innodb_notembedded [ fail ] Test ended at 2026-04-22 15:56:56 CURRENT_TEST: main.selectivity_innodb_notembedded --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.result 2026-04-17 18:40:40.486801590 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb_notembedded.reject 2026-04-22 15:56:56.304817186 +0300 @@ -74,16 +74,7 @@ select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel from information_schema.optimizer_trace; sel -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.035714283 - } - ] -] +NULL set optimizer_trace=@tmp; drop table t0,t1,t10; set histogram_size=@save_histogram_size; @@ -127,7 +118,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -139,14 +130,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col0", - "ranges": - ["1 < col0"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL $query_tbl; EXPLAIN { @@ -161,7 +145,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 53.32928848, + "filtered": 28.51019669, "attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1" } } @@ -173,14 +157,7 @@ from information_schema.optimizer_trace; JS -[ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } -] +NULL # # Check if not being able to infer anything for the first MAX_KEY # columns doesn't prevent further inferences. @@ -202,7 +179,7 @@ "loops": 1, "rows": 100, "cost": 0.0322836, - "filtered": 99.60784149, + "filtered": 99.21875, "attached_condition": "(t1.col1 > 1 or t1.col2 > 1 or t1.col3 > 1 or t1.col4 > 1 or t1.col5 > 1 or t1.col6 > 1 or t1.col7 > 1 or t1.col8 > 1 or t1.col9 > 1 or t1.col10 > 1 or t1.col11 > 1 or t1.col12 > 1 or t1.col13 > 1 or t1.col14 > 1 or t1.col15 > 1 or t1.col16 > 1 or t1.col17 > 1 or t1.col18 > 1 or t1.col19 > 1 or t1.col20 > 1 or t1.col21 > 1 or t1.col22 > 1 or t1.col23 > 1 or t1.col24 > 1 or t1.col25 > 1 or t1.col26 > 1 or t1.col27 > 1 or t1.col28 > 1 or t1.col29 > 1 or t1.col30 > 1 or t1.col31 > 1 or t1.col32 > 1 or t1.col33 > 1 or t1.col34 > 1 or t1.col35 > 1 or t1.col36 > 1 or t1.col37 > 1 or t1.col38 > 1 or t1.col39 > 1 or t1.col40 > 1 or t1.col41 > 1 or t1.col42 > 1 or t1.col43 > 1 or t1.col44 > 1 or t1.col45 > 1 or t1.col46 > 1 or t1.col47 > 1 or t1.col48 > 1 or t1.col49 > 1 or t1.col50 > 1 or t1.col51 > 1 or t1.col52 > 1 or t1.col53 > 1 or t1.col54 > 1 or t1.col55 > 1 or t1.col56 > 1 or t1.col57 > 1 or t1.col58 > 1 or t1.col59 > 1 or t1.col60 > 1 or t1.col61 > 1 or t1.col62 > 1 or t1.col63 > 1 or t1.col64 > 1 or t1.col65 > 1 or t1.col66 > 1 or t1.col67 > 1 or t1.col68 > 1 or t1.col69 > 1 or t1.col70 > 1 or t1.col71 > 1 or t1.col72 > 1 or t1.col73 > 1 or t1.col74 > 1 or t1.col75 > 1 or t1.col76 > 1 or t1.col77 > 1 or t1.col78 > 1 or t1.col79 > 1 or t1.col80 > 1 or t1.col81 > 1 or t1.col82 > 1 or t1.col83 > 1 or t1.col84 > 1 or t1.col85 > 1 or t1.col86 > 1 or t1.col87 > 1 or t1.col88 > 1 or t1.col89 > 1 or t1.col90 > 1 or t1.col91 > 1 or t1.col92 > 1 or t1.col93 > 1 or t1.col94 > 1 or t1.col95 > 1 or t1.col96 > 1 or t1.col97 > 1 or t1.col98 > 1 or t1.col99 > 1 or t1.col100 > 1 or t1.col101 > 1 or t1.col102 > 1 or t1.col103 > 1 or t1.col104 > 1 or t1.col105 > 1 or t1.col106 > 1 or t1.col107 > 1 or t1.col108 > 1 or t1.col109 > 1 or t1.col110 > 1 or t1.col111 > 1 or t1.col112 > 1 or t1.col113 > 1 or t1.col114 > 1 or t1.col115 > 1 or t1.col116 > 1 or t1.col117 > 1 or t1.col118 > 1 or t1.col119 > 1 or t1.col120 > 1 or t1.col121 > 1 or t1.col122 > 1 or t1.col123 > 1 or t1.col124 > 1 or t1.col125 > 1 or t1.col126 > 1 or t1.col127 > 1 or t1.col128 > 1 or t1.col129 > 1 or t1.col130 > 1 or t1.col131 > 1 or t1.col132 > 1 or t1.col133 > 1 or t1.col134 > 1 or t1.col135 > 1 or t1.col136 > 1 or t1.col137 > 1 or t1.col138 > 1 or t1.col139 > 1 or t1.col140 > 1 or t1.col141 > 1 or t1.col142 > 1 or t1.col143 > 1 or t1.col144 > 1 or t1.col145 > 1 or t1.col146 > 1 or t1.col147 > 1 or t1.col148 > 1 or t1.col149 > 1 or t1.col150 > 1 or t1.col151 > 1 or t1.col152 > 1 or t1.col153 > 1 or t1.col154 > 1 or t1.col155 > 1 or t1.col156 > 1 or t1.col157 > 1 or t1.col158 > 1) and t1.col159 > 1" } } @@ -214,16 +191,7 @@ from information_schema.optimizer_trace; JS -[ - [ - { - "column_name": "col159", - "ranges": - ["1 < col159"], - "selectivity_from_histogram": 0.996078431 - } - ] -] +NULL set optimizer_trace=@trace_tmp; drop table t1; # @@ -260,14 +228,7 @@ from opt_trace; JS -[ - [ - { - "index_name": "PRIMARY", - "selectivity_from_index": 0.005 - } - ] -] +NULL # Must not include 1.79...e308 as cost: select json_detailed(json_extract(trace,'$**.best_access_path')) as JS @@ -276,7 +237,7 @@ JS [ { - "table": "t1", + "table": "optimizer_context", "plan_details": { "record_count": 1 @@ -284,22 +245,21 @@ "considered_access_paths": [ { - "access_type": "range", - "range_index": "PRIMARY", - "rows": 5, - "rows_after_filter": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "access_type": "scan", + "rows": 100, + "rows_after_filter": 100, + "rows_out": 100, + "cost": 0.0243234, + "index_only": false, "chosen": true } ], "chosen_access_method": { - "type": "range", - "index": "PRIMARY", - "rows_read": 5, - "rows_out": 2.490196078, - "cost": 0.00935932, + "type": "scan", + "rows_read": 100, + "rows_out": 100, + "cost": 0.0243234, "uses_join_buffering": false } } Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.selectivity_innodb_notembedded/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.costs [ fail ] Test ended at 2026-04-22 15:57:06 CURRENT_TEST: main.costs --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.result 2026-04-17 18:40:40.367794237 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/costs.reject 2026-04-22 15:57:05.629788037 +0300 @@ -7,87 +7,87 @@ explain select sum(e) as "table_scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 12 -Last_query_cost 0.012556 +Last_query_cost 0.024323 explain select sum(a) as "index scan" from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Range scans should be used if we don't examine all rows in the table # explain select count(a) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -Last_query_cost 0.000000 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index -Last_query_cost 0.002877 +Last_query_cost 0.024323 explain select count(*) from t1 where a > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index -Last_query_cost 0.002747 +Last_query_cost 0.024323 # # Shorter indexes are preferred over longer indexes # explain select sum(a+b) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL ba 9 NULL 12 Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 explain select count(*) from t1 where b between 5 and 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index -Last_query_cost 0.002097 +Last_query_cost 0.024323 explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' explain select count(*) from t1 where b > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 explain select count(*) from t1 where d > 6; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index -Last_query_cost 0.001967 +Last_query_cost 0.024323 # # Check covering index usage # explain select a,b,c from t1 where a=b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index -Last_query_cost 0.007441 +Last_query_cost 0.024323 # # Prefer ref keys over ranges # explain select count(*) from t1 where b=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=2 and c=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba,bda,cba,cb cba 10 const,const 2 Using index -Last_query_cost 0.001141 +Last_query_cost 0.024323 explain select count(*) from t1 where b=3 and c between 3 and 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index -Last_query_cost 0.001577 +Last_query_cost 0.024323 # # Prefer eq keys over ref keys # explain select a,b,e from t1 where a=10 or a=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition -Last_query_cost 0.003126 +Last_query_cost 0.024323 explain select a,b,e from t1 where d=10 or d=11; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range d d 5 NULL 2 Using index condition -Last_query_cost 0.003291 +Last_query_cost 0.024323 drop table t1; # # MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in @@ -120,8 +120,6 @@ KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) ) ENGINE= InnoDB; explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range l_suppkey l_suppkey 10 NULL 1 Using where; Using index drop table t1; set global InnoDB.optimizer_disk_read_ratio=@save; # @@ -153,48 +151,5 @@ b >= date '1993-06-01' and b < date '1993-06-01' + interval '3' month and exists (select * from t2 where e = t1.a and g < h) group by c; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": 12.53886553, - "filesort": { - "sort_key": "t1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "possible_keys": ["PRIMARY", "t1_ix1"], - "loops": 1, - "rows": 7000, - "cost": 1.1518548, - "filtered": 100, - "attached_condition": "t1.b >= DATE'1993-06-01' and t1.b < (DATE'1993-06-01' + interval '3' month)" - } - }, - { - "table": { - "table_name": "t2", - "access_type": "ref", - "possible_keys": ["PRIMARY"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["e"], - "ref": ["test.t1.a"], - "loops": 7000, - "rows": 1, - "cost": 6.7528092, - "filtered": 100, - "attached_condition": "t2.g < t2.h", - "first_match": "t1" - } - } - ] - } - } - } -} set max_heap_table_size=@save_mhts; drop table t1, t2; Result length mismatch - saving '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' to '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.costs/' 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 19011 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=19011 --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 927895 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: 19011 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 927895) ReplayTest: Loading context ReplayTest: Loading context 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 ] 11048 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 13434 main.large_pages [ pass ] 15 main.flush_block_commit_notembedded [ pass ] 1209 main.drop_table_force [ pass ] 102 main.alter_table_online_debug 'binlog' [ pass ] 2560 main.innodb_mysql_lock2 [ pass ] 1348 main.alter_table_online 'binlog' [ pass ] 273 main.bug39022 [ pass ] 47 main.commit_1innodb [ pass ] 851 main.create_select [ pass ] 27 main.sp_trans [ pass ] 480 main.xa_binlog [ pass ] 23 main.partition_exchange [ pass ] 340 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_innodb [ fail ] Test ended at 2026-04-22 15:58:04 CURRENT_TEST: main.stat_tables_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.result 2026-04-02 14:38:09.473657332 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/stat_tables_innodb.reject 2026-04-22 15:58:04.205605047 +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_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:\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' @@ -436,8 +461,6 @@ FLUSH TABLES; SET use_stat_tables='preferably'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # 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-22 15:58:18 CURRENT_TEST: main.selectivity_innodb --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.result 2026-04-02 14:38:09.454657383 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/selectivity_innodb.reject 2026-04-22 15:58:17.631563131 +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.11 Using 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.67 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 @@ -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.40 Using 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.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 +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.40 Using 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.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 +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 ] 2504 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 15:58:23 CURRENT_TEST: main.partition_explicit_prune --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.result 2026-04-17 18:40:40.465800292 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_explicit_prune.reject 2026-04-22 15:58:23.243768783 +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 @@ -578,7 +580,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -596,7 +598,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_ROLLBACK 1 @@ -612,7 +614,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_ROLLBACK 1 @@ -627,7 +629,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 4 HANDLER_DELETE 2 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 8 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 112 HANDLER_ROLLBACK 1 @@ -650,7 +652,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 140 HANDLER_ROLLBACK 1 @@ -670,7 +672,7 @@ HANDLER_COMMIT 5 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 168 HANDLER_ROLLBACK 1 @@ -697,6 +699,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 4 +HANDLER_READ_KEY 6 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 # 1 commit @@ -774,7 +777,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 12 HANDLER_READ_RND_NEXT 2 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -793,7 +796,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 # 1 commit @@ -807,7 +810,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 2 @@ -822,6 +825,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -831,6 +835,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing, since impossible PARTITION+WHERE clause. FLUSH STATUS; @@ -875,7 +880,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 1 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_TMP_WRITE 24 HANDLER_UPDATE 1 @@ -905,6 +910,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -913,6 +919,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 6 HANDLER_TMP_WRITE 24 # Nothing (no matching partition found) FLUSH STATUS; @@ -928,7 +935,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND 1 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 @@ -942,7 +949,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -958,7 +965,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 14 HANDLER_READ_RND 2 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -988,7 +995,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_TMP_WRITE 24 # 1 delete # 4 locks (pruning works!). @@ -1000,6 +1007,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_DELETE 2 +HANDLER_READ_KEY 6 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 1 delete @@ -1020,7 +1028,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 2 -HANDLER_READ_KEY 1 +HANDLER_READ_KEY 7 HANDLER_READ_RND_NEXT 28 HANDLER_TMP_WRITE 51 # + 3 read key (1 innodb_get_index in records_in_range @@ -1031,7 +1039,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 56 HANDLER_TMP_WRITE 78 @@ -1044,7 +1052,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 3 HANDLER_DELETE 2 -HANDLER_READ_KEY 3 +HANDLER_READ_KEY 15 HANDLER_READ_NEXT 1 HANDLER_READ_RND_NEXT 84 HANDLER_TMP_WRITE 105 @@ -1059,7 +1067,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1095,6 +1103,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 +HANDLER_READ_KEY 12 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 7 @@ -1107,7 +1116,7 @@ VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 HANDLER_READ_FIRST 5 -HANDLER_READ_KEY 6 +HANDLER_READ_KEY 18 HANDLER_READ_NEXT 5 HANDLER_TMP_WRITE 24 HANDLER_WRITE 10 @@ -1216,6 +1225,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE HANDLER_COMMIT 1 +HANDLER_READ_KEY 15 HANDLER_READ_RND_NEXT 3 HANDLER_TMP_WRITE 24 # 12 locks (3 in t1, 1 in t3, 2 in t2) x 2 (lock + unlock) @@ -1233,7 +1243,7 @@ HANDLER_COMMIT 1 HANDLER_DELETE 6 HANDLER_READ_FIRST 1 -HANDLER_READ_KEY 2 +HANDLER_READ_KEY 17 HANDLER_READ_NEXT 2 HANDLER_READ_RND 4 HANDLER_READ_RND_NEXT 22 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 ] 682 ReplayTest: Loading context main.partition_innodb2 [ pass ] 72 main.repair [ pass ] 1637 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'a' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(part) VALUES (0) ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'a' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(part) VALUES (1) ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'a' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(part) VALUES (2) 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-22 15:58:31 CURRENT_TEST: main.multi_update --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.result 2026-04-17 18:40:40.439798686 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/multi_update.reject 2026-04-22 15:58:30.870196164 +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 ] 25012 main.alter_table_locknone [ pass ] 141 main.auto_increment_ranges_innodb [ pass ] 259 main.innodb_mysql_sync [ pass ] 15470 main.mysql_upgrade-20228 [ pass ] 1016 main.mysql_upgrade_to_100502 [ pass ] 1070 main.partition_alter [ pass ] 224 main.partition_cache [ pass ] 125 main.partition_cache_innodb [ pass ] 1043 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 15:59:20 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-22 15:59:19.954495060 +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 ] 27 main.partition_geometries [ 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 main.partition_innodb [ pass ] 4007 main.partition_innodb_plugin [ pass ] 95 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-22 15:59:27 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-22 15:59:27.100346394 +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 ] 51 main.type_datetime_hires [ pass ] 131 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 15:59:34 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-22 15:59:33.594518475 +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)); @@ -4231,7 +4231,7 @@ 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 @@ -4267,7 +4267,7 @@ 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 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 ] 7999 main.bug46760 [ pass ] 28 main.row-checksum-old [ pass ] 58 main.row-checksum [ pass ] 34 main.backup_locks [ pass ] 49519 main.backup_interaction [ pass ] 224 main.backup_lock [ pass ] 3620 main.backup_priv [ pass ] 25 main.backup_stages [ pass ] 15273 main.backup_syntax [ pass ] 21 main.innodb_mysql_lock [ pass ] 2139 main.mdl [ pass ] 43 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:01:22 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-22 16:01:21.908988626 +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 ] 276 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1064 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: Failed query was: CREATE DATABASE IF NOT EXISTS ReplayTest: Loading context ReplayTest: Loading context main.cte_recursive [ fail ] Test ended at 2026-04-22 16:01:30 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-22 16:01:29.969963526 +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,6 @@ 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` set standard_compliant_cte=default; drop table flights; # @@ -3863,7 +3854,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 +3872,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 +3902,6 @@ 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 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 +4094,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 +4104,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 +4350,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 +4446,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 failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t2 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t1 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:01:33 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-22 16:01:33.317601626 +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 ] 1164 main.analyze_engine_stats 'slow_query_log_on' [ pass ] 1132 main.stat_tables_innodb_debug [ 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 main.delete_use_source [ fail ] Test ended at 2026-04-22 16:01:54 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-22 16:01:53.687134580 +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 ] 146534 ReplayTest: Loading context ReplayTest: Loading context main.analyze [ pass ] 254 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:04:32 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-22 16:04:31.494803143 +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-22 16:04:36 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-22 16:04:35.943385024 +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 ] 2042 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:04:41 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-22 16:04:40.603875319 +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-22 16:04:43 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-22 16:04:42.602583086 +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-22 16:04:44 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-22 16:04:44.520358367 +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 ] 23 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.index_merge_innodb_notembedded [ fail ] Test ended at 2026-04-22 16:04:46 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-22 16:04:45.753354536 +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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context main.information_schema [ fail ] Test ended at 2026-04-22 16:04:50 CURRENT_TEST: main.information_schema --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/information_schema.result 2026-04-17 18:40:40.425797821 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/information_schema.reject 2026-04-22 16:04:50.319340344 +0300 @@ -362,9 +362,6 @@ explain select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where a.ROUTINE_SCHEMA = b.SCHEMA_NAME; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE # ALL NULL NULL NULL NULL NULL -1 SIMPLE # ALL NULL NULL NULL NULL NULL Using where; Using join buffer (flat, BNL join) select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a, mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1; ROUTINE_NAME name @@ -1467,8 +1464,7 @@ 1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort explain select * from (select table_name from information_schema.tables) as a; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 100 -2 DERIVED tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases +1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort set optimizer_switch=@tmp_optimizer_switch; drop view v1; create table t1 (f1 int(11)); @@ -1722,28 +1718,15 @@ SET GLOBAL event_scheduler=0; explain select table_name from information_schema.views where table_schema='test' and table_name='v1'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE views ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_frm_only; Scanned 0 databases explain select * from information_schema.tables; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases explain select * from information_schema.collations; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE collations ALL NULL NULL NULL NULL NULL explain select * from information_schema.tables where table_schema='test' and table_name= 't1'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE tables ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases explain select table_name, table_type from information_schema.tables where table_schema='test'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE tables ALL NULL TABLE_SCHEMA NULL NULL NULL Using where; Open_frm_only; Scanned 1 database explain select b.table_name from information_schema.tables a, information_schema.columns b where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Skip_open_table; Scanned 0 databases -1 SIMPLE b ALL NULL NULL NULL NULL NULL Using where; Open_frm_only; Scanned all databases; Using join buffer (flat, BNL join) SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'mysqltest'; CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT @@ -1822,10 +1805,6 @@ select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM explain extended select 1 from information_schema.tables; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE tables ALL NULL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases -Warnings: -Note 1003 select 1 AS `1` from `information_schema`.`tables` use information_schema; show events; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation @@ -1866,14 +1845,8 @@ connection default; disconnect conn1; explain select count(*) from information_schema.tables; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases explain select count(*) from information_schema.columns; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE columns ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases explain select count(*) from information_schema.views; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE views ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases set global init_connect="drop table if exists t1;drop table if exists t1;\ drop table if exists t1;drop table if exists t1;\ drop table if exists t1;drop table if exists t1;\ @@ -2064,23 +2037,13 @@ disconnect con3726_2; drop tables t1, t3; EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE KEY_COLUMN_USAGE ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases EXPLAIN SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE PARTITIONS ALL NULL TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 1 database EXPLAIN SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE REFERENTIAL_CONSTRAINTS ALL NULL CONSTRAINT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME='t1' and TABLE_SCHEMA='test'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE TABLE_CONSTRAINTS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE EVENT_OBJECT_SCHEMA='test'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE TRIGGERS ALL NULL EVENT_OBJECT_SCHEMA NULL NULL NULL Using where; Open_frm_only; Scanned 1 database create table information_schema.t1 (f1 INT); ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' drop table information_schema.t1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.information_schema/' ***Warnings generated in error logs during shutdown after running tests: main.information_schema 2026-04-22 16:04:50 4 [Warning] Sort aborted, host: localhost, user: root, thread: 4, query: SELECT * FROM v LIMIT ROWS EXAMINED 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 main.innodb_icp [ pass ] 1621 ReplayTest: Loading context ReplayTest: Loading context main.join_optimizer [ pass ] 233 main.log_slow_innodb [ pass ] 274 main.opt_context_load_stats_innodb [ 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 ReplayTest: Loading context main.opt_ctx_replay_innodb_complement [ fail ] Test ended at 2026-04-22 16:04:56 CURRENT_TEST: main.opt_ctx_replay_innodb_complement --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_ctx_replay_innodb_complement.result 2026-04-17 18:40:40.452799489 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_ctx_replay_innodb_complement.reject 2026-04-22 16:04:56.243321933 +0300 @@ -107,6 +107,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -229,6 +231,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -346,6 +350,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -467,6 +473,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -592,6 +600,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -713,6 +723,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -819,6 +831,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -915,6 +929,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -993,6 +1009,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1080,6 +1098,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1165,6 +1185,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1249,6 +1271,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1358,6 +1382,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1492,6 +1518,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_ctx_replay_innodb_complement/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 [ fail ] Test ended at 2026-04-22 16:04:58 CURRENT_TEST: main.opt_ctx_replay_innodb_preferably --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_ctx_replay_innodb_preferably.result 2026-04-17 18:40:40.452799489 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_ctx_replay_innodb_preferably.reject 2026-04-22 16:04:58.053316308 +0300 @@ -107,6 +107,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -229,6 +231,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -346,6 +350,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -467,6 +473,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -592,6 +600,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -713,6 +723,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -819,6 +831,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -915,6 +929,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -993,6 +1009,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1080,6 +1098,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1165,6 +1185,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1249,6 +1271,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1358,6 +1382,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { @@ -1492,6 +1518,8 @@ Warning 4200 The setting 'optimizer_adjust_secondary_key_costs' is ignored. It only exists for compatibility with old installations and will be removed in a future release Warnings: Note 1007 Can't create database 'db1'; database exists +Warnings: +Note 1051 Unknown table 'db1.t1' EXPLAIN { "query_block": { Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.opt_ctx_replay_innodb_preferably/' ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1655 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1050 Table 'seq_1_to_10000' already exists ReplayTest: Failed query was: CREATE TABLE `seq_1_to_10000` ( `seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`) ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ReplayTest: Loading context ReplayTest: Query failed on replay server: 1050 Table 'seq_1_to_10000' already exists ReplayTest: Failed query was: CREATE TABLE `seq_1_to_10000` ( `seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`) ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ReplayTest: Loading context 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-22 16:05:01 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-22 16:05:01.264306330 +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 ] 626 ReplayTest: Loading context main.optimizer_crash [ pass ] 154 ReplayTest: Loading context 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 ] 1362 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.order_by_optimizer_innodb [ pass ] 404 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:05:14 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-22 16:05:13.648267848 +0300 @@ -637,13 +637,7 @@ 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 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` drop table t1; CREATE TABLE t1 ( `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000', @@ -2128,13 +2122,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 +2382,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 +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/' 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 ] 8904 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:05:32 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-22 16:05:32.503209264 +0300 @@ -640,13 +640,7 @@ 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 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` drop table t1; CREATE TABLE t1 ( `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000', @@ -2131,13 +2125,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 +2385,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 +3723,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-22 16:05:48 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-22 16:05:48.458159697 +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 @@ -1311,7 +1357,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 385 Handler_read_prev 0 @@ -1340,7 +1386,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 13 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 @@ -1371,7 +1417,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 13 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 @@ -1402,7 +1448,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 13 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 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 ] 236 ReplayTest: Loading context ReplayTest: Loading context main.subselect_elimination [ pass ] 139 ReplayTest: Loading context ReplayTest: Loading context 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-22 16:05:57 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-22 16:05:56.762133902 +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-22 16:06:00 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-22 16:05:59.497125406 +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 failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t1 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t1 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t2 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_sj2_jcl6 [ fail ] Test ended at 2026-04-22 16:06:02 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-22 16:06:02.388116426 +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-22 16:06:09 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-22 16:06:09.288920591 +0300 @@ -714,7 +714,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 1 Handler_read_prev 0 @@ -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 failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 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 ReplayTest: Failed query was: explain update t1 set c1=c1 +(select max(a.c2) from v1 a where a.c1 = t1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + (select max(a.c2) from t1 a where a.c1 = v1.c1) +10 where c3 > 3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: explain update v1 set c1=c1 + 1 where c1 <2 and exists (select 'X' from v1 a where a.c1 = v1.c1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 4254 Failed to match the stats from replay context with the optimizer stats: test.v1 doesn't exist in list of table contexts ReplayTest: Failed query was: 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) 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-22 16:06:20 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-22 16:06:20.410060450 +0300 @@ -332,9 +332,6 @@ 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 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 +387,6 @@ 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 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 +442,6 @@ 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 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 +783,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 +839,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 +956,6 @@ 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 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 +1011,6 @@ 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 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 +1066,6 @@ 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 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 +1585,6 @@ 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 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 +1640,6 @@ 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 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 +1695,6 @@ 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 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 +2849,6 @@ 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 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 +2904,6 @@ 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 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 +2959,6 @@ 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 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 +3300,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 +3356,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 +3473,6 @@ 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 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 +3528,6 @@ 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 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 +3583,6 @@ 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 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 +4102,6 @@ 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 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 +4157,6 @@ 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 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 +4212,6 @@ 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 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 +5366,6 @@ 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 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 +5421,6 @@ 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 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 +5476,6 @@ 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 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 +5817,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 +5873,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 +5990,6 @@ 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 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 +6045,6 @@ 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 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 +6100,6 @@ 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 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 +6619,6 @@ 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 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 +6674,6 @@ 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 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 +6729,6 @@ 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 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 +7883,6 @@ 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 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 +7938,6 @@ 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 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 +7993,6 @@ 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 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 +8449,6 @@ 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 update t1 set c1=c1 +(select max(a.c2) from v1 a where a.c1 = t1.c1); affected rows: 32 @@ -8602,11 +8499,10 @@ 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 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 +8555,11 @@ 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 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 +8611,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 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 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 +9133,6 @@ 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 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 +9188,6 @@ 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 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 +9243,6 @@ 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 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 ] 4266 main.vector_innodb [ pass ] 921 main.mysql_upgrade_mysql_json_datatype [ pass ] 3286 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 ] 4854 main.plugin_innodb [ pass ] 1746 main.xa_prepared_binlog_off [ pass ] 3068 main.temp_table [ pass ] 158 main.stat_tables_par_innodb [ pass ] 4827 ReplayTest: Loading context ReplayTest: Loading context main.statistics [ pass ] 2580 main.statistics_index_crash-7362 [ pass ] 33 main.alter_events [ pass ] 156 main.alter_table [ pass ] 3574 main.alter_table_autoinc-5574 [ pass ] 12 main.alter_table_errors [ pass ] 15 main.alter_table_lock [ pass ] 112 main.alter_table_online 'nobinlog' [ pass ] 179 main.alter_table_trans [ pass ] 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 main.analyze_stmt_orderby [ pass ] 266 main.backup_lock_debug [ pass ] 36 main.backup_log [ pass ] 100 main.bootstrap_innodb [ pass ] 1998 main.cache_innodb [ pass ] 118 main.check_constraint_innodb [ pass ] 22 main.column_compression [ pass ] 672 main.commit [ pass ] 59 main.concurrent_innodb_safelog [ pass ] 9423 main.concurrent_innodb_unsafelog [ pass ] 5333 main.consistent_snapshot [ pass ] 15 main.ctype_filename_innodb [ pass ] 13 main.ctype_sjis_innodb [ pass ] 56 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-22 16:07:23 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-22 16:07:22.646867187 +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 ] 2121 main.ctype_utf32_innodb [ pass ] 13 main.ctype_utf8mb3_innodb [ pass ] 22 ReplayTest: Loading context main.ctype_utf8mb4_0900 [ pass ] 177 main.deadlock_innodb [ pass ] 6120 main.debug_sync [ pass ] 77 main.default [ pass ] 525 main.default_innodb [ pass ] 19 main.delete_multi_order_by [ pass ] 87 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:07:42 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-22 16:07:42.237806370 +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 ] 111 main.drop [ pass ] 95 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.endspace [ pass ] 153 ReplayTest: Loading context main.explain_innodb [ pass ] 41 ReplayTest: Loading context main.explain_json_innodb [ pass ] 78 ReplayTest: Loading context main.ext_key_noPK_6794 [ pass ] 29 main.fast_prefix_index_fetch_innodb [ pass ] 44 main.flush-innodb [ pass ] 119 main.flush-innodb-notembedded [ pass ] 17 main.flush_block_commit [ pass ] 1044 main.flush_read_lock [ pass ] 5628 main.flush_read_lock_kill [ pass ] 133 main.foreign_key [ pass ] 38 main.foreign_key_lowercase0 [ pass ] 10 ReplayTest: Loading context main.func_analyse [ 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 main.func_group_innodb [ fail ] Test ended at 2026-04-22 16:07:54 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-22 16:07:54.270769017 +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 ] 223 main.func_rollback [ pass ] 92 main.function_defaults_innodb [ pass ] 1007 main.get_diagnostics [ pass ] 121 main.gis-alter_table [ 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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:08:16 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-22 16:08:16.272700723 +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: 57, expected: 56 ### 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: 57, expected: 56 ### 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: 57, expected: 56 ### ##### ## 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: 9062, expected: 9077 ### 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: 9062, expected: 9077 ### ##### ## 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 ] 191 main.ignored_index_innodb [ pass ] 16 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:08:21 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-22 16:08:21.352684956 +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 ] 6309 main.information_schema-big_embedded [ skipped ] Test requires: embedded server main.information_schema_db [ pass ] 244 main.information_schema_inno [ pass ] 104 main.information_schema_temp_table [ pass ] 177 ReplayTest: Loading context main.innodb_bug878769 [ pass ] 52 main.innodb_group [ pass ] 12 ReplayTest: Loading context main.innodb_icp_debug [ pass ] 179 ReplayTest: Loading context ReplayTest: Loading context 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 ] 649 main.innodb_utf8 [ pass ] 18 main.insert_innodb [ pass ] 42 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-22 16:08:33 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-22 16:08:33.532647154 +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 ] 23 main.kill [ pass ] 206 main.kill_debug [ pass ] 123 main.leaks [ pass ] 12 main.loaddata_innodb [ pass ] 28 main.lock_kill [ pass ] 43 main.locked_temporary-5955 [ pass ] 7 main.locking_clause [ pass ] 38 main.log_tables_upgrade [ pass ] 1129 main.long_unique_innodb_debug [ pass ] 1139 main.mariadb-dump-debug [ pass ] 114 main.mariadb-import [ pass ] 1856 main.mdev-35046 [ pass ] 1444 main.mdev-35721-ubsan [ pass ] 58 ReplayTest: Loading context main.mdev13607 [ pass ] 239 main.mdev_32854 [ pass ] 2312 ReplayTest: Loading context main.mrr_derived_crash_4610 [ pass ] 113 main.multi_update_innodb [ pass ] 146 main.mysql57nopart [ pass ] 5 main.mysql_tzinfo_to_sql_symlink [ pass ] 224 main.mysql_upgrade_noengine [ pass ] 3475 main.mysql_upgrade_ssl [ pass ] 1121 main.mysqldump-order-by-size [ pass ] 81 main.mysqldump-system 'unix' [ pass ] 360 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 3680 ReplayTest: Loading context main.opt_hints_subquery_innodb [ pass ] 58 ReplayTest: Loading context main.opt_trace_index_merge_innodb [ fail ] Test ended at 2026-04-22 16:09: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-22 16:09:01.927559039 +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 ] 2458 main.percona_nonflushing_analyze_debug [ pass ] 14 main.progress_976225 [ pass ] 38 main.ps_innodb [ pass ] 44 main.ps_missed_cmds [ pass ] 66 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 ] 5 main.ps_qc_innodb [ pass ] 653 main.query_cache_innodb [ pass ] 88 main.read_only_innodb [ pass ] 91 main.reopen_temp_table [ pass ] 65 ReplayTest: Loading context main.rowid_order_innodb [ pass ] 101 main.servers [ pass ] 72 main.show_analyze [ pass ] 1241 main.show_analyze_json [ pass ] 1232 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.show_explain_json [ fail ] Test ended at 2026-04-22 16:09:32 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-22 16:09:31.560467102 +0300 @@ -76,64 +76,12 @@ 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 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 connection con1; max(c) 9 @@ -177,33 +125,6 @@ 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 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 +589,7 @@ 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 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 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -838,79 +687,7 @@ 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 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 connection con1; drop table t2; SET debug_dbug=@old_debug; @@ -1073,140 +850,8 @@ 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 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 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 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 ] 124 main.simultaneous_assignment [ pass ] 43 main.single_delete_update_innodb [ pass ] 11 main.sp-group [ pass ] 31 main.sp-innodb [ pass ] 4088 main.ssl_and_innodb [ pass ] 13 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_disabled [ pass ] 5637 main.statistics_upgrade_not_done [ pass ] 2529 main.strict_autoinc_2innodb [ pass ] 12 main.subselect-crash_15755 [ pass ] 86 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t3 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1451 Cannot delete or update a parent row: a foreign key constraint fails ReplayTest: Failed query was: DROP TABLE IF EXISTS test.t3 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect2 [ fail ] Test ended at 2026-04-22 16:10:17 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-22 16:10:16.771326857 +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 ] 15 main.system_mysql_db_fix40123 [ pass ] 841 main.system_mysql_db_fix50030 [ pass ] 674 main.system_mysql_db_fix50117 [ pass ] 1031 main.system_mysql_db_fix50568 [ pass ] 868 main.tablelock [ pass ] 49 main.tmp_table_error [ pass ] 230 main.transaction_timeout [ pass ] 8034 main.trigger-trans [ pass ] 2124 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.type_bit_innodb [ pass ] 256 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.type_blob [ fail ] Test ended at 2026-04-22 16:11:06 CURRENT_TEST: main.type_blob --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_blob.result 2026-04-17 18:40:40.517803506 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/type_blob.reject 2026-04-22 16:11:05.847174627 +0300 @@ -525,10 +525,6 @@ charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat')), collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat')), coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat')); -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 charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `charset(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))`,collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `collation(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))`,coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat')) AS `coercibility(load_file('MYSQLTEST_VARDIR/std_data/words.dat'))` update t1 set imagem=load_file('MYSQLTEST_VARDIR/std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; if(imagem is null, "ERROR", "OK") length(imagem) @@ -961,14 +957,8 @@ cast(null as binary(4294967295)) binary(0) YES NULL drop table b15776; explain select cast(1 as char(4294967295)); -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 explain select cast(1 as nchar(4294967295)); -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 explain select cast(1 as binary(4294967295)); -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 explain select cast(1 as char(4294967296)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select cast(1 as nchar(4294967296)); @@ -978,8 +968,6 @@ explain select cast(1 as decimal(-1)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-1))' at line 1 explain select cast(1 as decimal(64, 30)); -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 explain select cast(1 as decimal(64, 999999999999999999999999999999)); Got one of the listed errors explain select cast(1 as decimal(4294967296)); @@ -987,22 +975,16 @@ explain select cast(1 as decimal(999999999999999999999999999999999999)); Got one of the listed errors explain select convert(1, char(4294967295)); -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 explain select convert(1, char(4294967296)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select convert(1, char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select convert(1, nchar(4294967295)); -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 explain select convert(1, nchar(4294967296)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select convert(1, nchar(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select convert(1, binary(4294967295)); -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 explain select convert(1, binary(4294967296)); ERROR 42000: Display width out of range for '1' (max = 4294967295) explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.type_blob/' main.type_num_innodb [ pass ] 57 main.type_temporal_innodb [ pass ] 48 main.type_time_hires [ pass ] 108 main.type_timestamp_hires [ pass ] 61 main.union_innodb [ pass ] 19 main.unique [ pass ] 11 main.unsafe_binlog_innodb [ pass ] 2194 ReplayTest: Loading context ReplayTest: Loading context main.update_innodb [ pass ] 3011 main.vector_symlink [ pass ] 30 main.warnings_debug [ pass ] 9 main.xa [ pass ] 7392 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 ] 1001 main.plugin_loaderr [ pass ] 1433 main.mysql_upgrade-28915 [ pass ] 2176 main.alter_table_combinations 'innodb' [ pass ] 130 main.myisam-blob [ 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 main.key_cache [ pass ] 486 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'b' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t1(a) VALUES ('2001-01-01 00:00:00') ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:12:31 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-22 16:12:31.147910093 +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 ` `; @@ -4439,7 +4443,7 @@ SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 9 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -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,6 @@ @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`()) DROP TABLE t1, t2; DROP FUNCTION f1; # End of bug#33546 @@ -5703,7 +5697,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 ] 61 main.ctype_cp932_binlog_stm [ pass ] 886 main.partition_binlog [ pass ] 109 main.alter_table-big [ pass ] 191 main.create-big [ pass ] 257 main.mysqlbinlog_row_big [ pass ] 1089 main.compound [ pass ] 190 main.create_drop_binlog [ pass ] 81 main.create_drop_function [ pass ] 21 main.ctype_gbk_binlog [ pass ] 60 main.flush_and_binlog [ pass ] 5031 main.mdev-31636 [ pass ] 1 main.multi_update_binlog [ pass ] 128 main.mysql_binary_mode [ pass ] 203 main.mysql_binary_zero_insert [ pass ] 307 main.mysql_upgrade_view [ pass ] 3203 main.mysqlbinlog_raw_mode [ pass ] 181 main.mysqldump_restore [ pass ] 793 main.mysqltest [ pass ] 10515 main.ps_change_master [ pass ] 16 main.trigger_wl3253 [ pass ] 239 main.user_var-binlog [ pass ] 63 main.system_mysql_db_error_log [ pass ] 54 main.show_check [ pass ] 267 ReplayTest: Loading context ReplayTest: Loading context main.status [ fail ] Test ended at 2026-04-22 16:14:18 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-22 16:14:18.284577979 +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 @@ -326,7 +326,7 @@ Handler_mrr_rowid_refills 0 Handler_prepare 0 Handler_read_first 0 -Handler_read_key 9 +Handler_read_key 24 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -372,7 +372,7 @@ Handler_mrr_rowid_refills 0 Handler_prepare 0 Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -406,7 +406,7 @@ SHOW STATUS LIKE 'Table_open_cache%'; Variable_name Value Table_open_cache_active_instances 1 -Table_open_cache_hits 72 +Table_open_cache_hits 207 Table_open_cache_misses 18 Table_open_cache_overflows 8 FLUSH TABLES; Result length 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.union [ fail ] Test ended at 2026-04-22 16:14:28 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-22 16:14:28.204547236 +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 @@ -2196,9 +2196,6 @@ # WL#1763 Avoid creating temporary table in UNION ALL # EXPLAIN SELECT 1 UNION ALL SELECT 1 LIMIT 1 OFFSET 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 UNION NULL NULL NULL NULL NULL NULL NULL No tables used # Bug #17579498 CHANGES IN DATATYPE OF THE RESULT QUERY IN UNION. CREATE TABLE t1 (a TIME); CREATE TABLE t2 (b DATETIME); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.union/' main.multi_statement [ pass ] 28 main.log_slow_filter [ pass ] 26 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.explain_slowquerylog [ fail ] Test ended at 2026-04-22 16:14:36 CURRENT_TEST: main.explain_slowquerylog --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_slowquerylog.result 2026-04-02 14:38:09.344657681 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/explain_slowquerylog.reject 2026-04-22 16:14:35.859523513 +0300 @@ -27,8 +27,6 @@ # MDEV-5060 Server crashes on EXPLAIN EXTENDED or EXPLAIN PARTITIONS with explain in slow_log # EXPLAIN PARTITIONS SELECT 1 ; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used # # MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT with explain in slow log # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.explain_slowquerylog/' main.analyze_stmt_slow_query_log [ pass ] 39 main.partition_blackhole [ pass ] 34 main.blackhole [ pass ] 38 main.mysqldump-compat [ pass ] 188 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context main.func_encrypt [ fail ] Test ended at 2026-04-22 16:14:48 CURRENT_TEST: main.func_encrypt --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_encrypt.result 2026-04-02 14:38:09.350657664 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_encrypt.reject 2026-04-22 16:14:48.134627213 +0300 @@ -315,14 +315,6 @@ Warning 1287 'des_decrypt' is deprecated and will be removed in a future release Warning 1108 Incorrect parameters to procedure 'des_decrypt' explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden")); -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: -Warning 1287 'des_encrypt' is deprecated and will be removed in a future release -Warning 1287 'des_decrypt' is deprecated and will be removed in a future release -Warning 1287 'des_encrypt' is deprecated and will be removed in a future release -Warning 1287 'des_decrypt' is deprecated and will be removed in a future release -Note 1003 select des_decrypt(des_encrypt('hello',4),'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt('hello','hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))` # # Start of 10.1 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_encrypt/' main.ssl_7937 'nossl' [ pass ] 69 main.ssl_autoverify 'auto,unix' [ pass ] 835 main.cli_options_force_protocol_win [ skipped ] Need windows main.mysqldump-win [ skipped ] Need windows main.ssl_autoverify 'pem,unix' [ pass ] 825 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 [ fail ] Test ended at 2026-04-22 16:15:14 CURRENT_TEST: main.partition --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition.result 2026-04-02 14:38:09.425657461 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition.reject 2026-04-22 16:15:14.214404655 +0300 @@ -563,7 +563,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 @@ -584,7 +584,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 @@ -617,7 +617,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 4 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -636,7 +636,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 4 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -655,7 +655,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 4 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -674,7 +674,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 4 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition/' ***Warnings generated in error logs during shutdown after running tests: main.partition 2026-04-22 16:15:14 4 [ERROR] Table ' mdev20498' corrupted: row in wrong partition: (0 != 1) a:1Please REPAIR the table! ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:15:26 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-22 16:15:26.499366582 +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.11 Using 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.67 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 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.40 Using 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.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 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.40 Using 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.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables [ fail ] Test ended at 2026-04-22 16:15:37 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-22 16:15:37.645791128 +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, @@ -404,8 +407,6 @@ FLUSH TABLES; SET use_stat_tables='preferably'; EXPLAIN SELECT * FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; # 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-22 16:15:42 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-22 16:15:42.221532177 +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 @@ -751,7 +750,7 @@ SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 1 -Handler_read_key 4 +Handler_read_key 15 Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 @@ -776,7 +775,7 @@ SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 1 -Handler_read_key 4 +Handler_read_key 15 Handler_read_last 0 Handler_read_next 4 Handler_read_prev 0 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-22 16:15:42 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-22 16:15:42 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-22 16:15:45 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-17 18:40:40.451799427 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_store_ddls.reject 2026-04-22 16:15:45.171308705 +0300 @@ -149,11 +149,13 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +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; +DROP VIEW IF EXISTS db1.view1; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW db1.view1 AS (select `db1`.`t1`.`a` AS `a`,`db1`.`t1`.`b` AS `b`,`db1`.`t2`.`a` AS `c` from (`db1`.`t1` join `db1`.`t2`) where `db1`.`t1`.`a` = `db1`.`t2`.`a`); @@ -185,6 +187,7 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +DROP TABLE IF EXISTS db1.temp1; CREATE TEMPORARY TABLE `temp1` ( `col1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; @@ -246,11 +249,13 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +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; +DROP VIEW IF EXISTS db1.view1; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW db1.view1 AS (select `db1`.`t1`.`a` AS `a`,`db1`.`t1`.`b` AS `b`,`db1`.`t2`.`a` AS `c` from (`db1`.`t1` join `db1`.`t2`) where `db1`.`t1`.`a` = `db1`.`t2`.`a`); @@ -355,6 +360,7 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +DROP TABLE IF EXISTS db1.t1; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL @@ -396,6 +402,7 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +DROP TABLE IF EXISTS db1.t1; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL @@ -433,6 +440,7 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +DROP TABLE IF EXISTS db1.t1; CREATE TABLE `db1`.`t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL @@ -512,6 +520,7 @@ 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 @@ -673,6 +682,7 @@ 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, @@ -712,6 +722,7 @@ `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`) @@ -743,6 +754,7 @@ `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`) 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-22 16:15:50 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-22 16:15:50.305292794 +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 [ fail ] Test ended at 2026-04-22 16:15:54 CURRENT_TEST: main.partition_range --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_range.result 2026-04-02 14:38:09.431657445 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_range.reject 2026-04-22 16:15:54.740679530 +0300 @@ -1007,7 +1007,7 @@ SHOW status LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 11 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -1023,7 +1023,7 @@ SHOW status LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 6 +Handler_read_key 11 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:15:59 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-22 16:15:59.518264239 +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: Loading context ReplayTest: Loading context main.sp [ fail ] Test ended at 2026-04-22 16:16:11 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-22 16:16:11.395227432 +0300 @@ -5969,22 +5969,18 @@ 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 +1 SIMPLE t1 ref c1 c1 5 const 1 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 +1 SIMPLE t1 ref c1 c1 5 const 1 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 +1 SIMPLE t1 ref c1 c1 5 const 1 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 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 DROP VIEW v1; DROP FUNCTION f1; DROP FUNCTION f2; @@ -8736,8 +8732,6 @@ 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 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 ] 7 main.partition_example [ pass ] 21 main.partition_not_windows [ pass ] 51 main.assign_key_cache [ pass ] 32 main.auto_increment_ranges_myisam [ pass ] 45 ReplayTest: Loading context ReplayTest: Loading context main.column_compression_parts [ pass ] 152 main.ctype_partitions [ pass ] 12 main.ctype_uca_partitions [ pass ] 28 main.drop_bad_db_type [ pass ] 19 main.enforce_storage_engine [ pass ] 23 ReplayTest: Loading context ReplayTest: Loading context main.explain_json_format_partitions [ 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.explain_non_select [ fail ] Test ended at 2026-04-22 16:16:44 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-22 16:16:44.239591802 +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 @@ -124,8 +122,6 @@ id select_type table type possible_keys key key_len ref rows Extra 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 drop table t0, t1; # # MDEV-5067: Valgrind warnings (Invalid read) in QPF_table_access::print_explain @@ -190,17 +186,11 @@ # 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 insert into t1 values (1),(2),(3); create table t2 (a int, b int); explain insert into t2 values (10, 1+(select max(a) from t1)), (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 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 ] 2238 main.identifier_partition [ 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 ReplayTest: Loading context main.ignored_index [ pass ] 475 main.information_schema_part [ pass ] 35 main.lock [ pass ] 102 ReplayTest: Loading context main.long_unique [ pass ] 330 main.partition_bug18198 [ pass ] 15 main.partition_cache_myisam [ pass ] 952 main.partition_charset [ pass ] 16 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-22 16:17:11 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-22 16:17:11.725040475 +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 ] 161 main.partition_csv [ pass ] 29 main.partition_datatype_32 [ skipped ] Need a 32 bit timestamps main.partition_datatype_64 [ 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.partition_default [ pass ] 634 main.partition_error [ pass ] 216 main.partition_grant [ 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 main.partition_hash [ pass ] 223 main.partition_key_cache [ pass ] 254 ReplayTest: Loading context ReplayTest: Loading context main.partition_list [ pass ] 82 main.partition_mgm [ pass ] 19 main.partition_mgm_err [ pass ] 39 main.partition_mgm_err2 [ pass ] 13 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-22 16:17:43 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-22 16:17:42.960238316 +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-22 16:17:45 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-22 16:17:45.680986555 +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 ] 1076 ReplayTest: Loading context main.partition_order [ pass ] 115 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 [ fail ] Test ended at 2026-04-22 16:18:02 CURRENT_TEST: main.partition_pruning --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_pruning.result 2026-04-02 14:38:09.431657445 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/partition_pruning.reject 2026-04-22 16:18:02.569882935 +0300 @@ -2941,7 +2941,7 @@ Handler_read_rnd_next 0 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 5 +Handler_read_key 9 flush status; update t2 set a = 111 where b in (5,6); show status like 'Handler_read_rnd_next'; @@ -2949,7 +2949,7 @@ Handler_read_rnd_next 915 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 0 +Handler_read_key 4 flush status; update t2 set a = 222 where b = 7; show status like 'Handler_read_rnd_next'; @@ -2957,7 +2957,7 @@ Handler_read_rnd_next 0 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 5 +Handler_read_key 9 flush status; delete from t2 where b = 7; show status like 'Handler_read_rnd_next'; @@ -2965,7 +2965,7 @@ Handler_read_rnd_next 0 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 5 +Handler_read_key 9 flush status; delete from t2 where b > 5; show status like 'Handler_read_rnd_next'; @@ -2976,7 +2976,7 @@ Handler_read_rnd_deleted 400 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 0 +Handler_read_key 4 show status like 'Handler_read_prev'; Variable_name Value Handler_read_prev 0 @@ -2993,7 +2993,7 @@ Handler_read_rnd_deleted 700 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 0 +Handler_read_key 4 show status like 'Handler_read_prev'; Variable_name Value Handler_read_prev 0 Result content mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.partition_pruning/' main.partition_rename_longfilename [ pass ] 52 main.partition_sp [ pass ] 5 main.partition_symlink [ pass ] 65 main.partition_sync [ pass ] 27 main.partition_truncate [ pass ] 24 main.partition_ucs2 [ pass ] 6 main.partition_utf8 [ pass ] 14 main.partition_utf8-debug [ pass ] 28 main.partition_windows [ skipped ] Need windows main.ps_mem_leaks [ pass ] 63 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sargable_casefold_part [ pass ] 93 main.stat_tables_partition [ pass ] 22 main.vector_partition [ pass ] 7 main.mysql_client_test_comp [ pass ] 35596 main.ssl_7937 'x509v3' [ pass ] 191 main.ssl_verify_ip [ pass ] 36 main.ssl_7937 'ssl' [ pass ] 181 main.failed_auth_unixsocket [ pass ] 1048 main.password_expiration_unix_socket [ pass ] 44 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_misc [ fail ] Test ended at 2026-04-22 16:19:58 CURRENT_TEST: main.func_misc --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_misc.result 2026-04-02 14:38:09.356657648 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_misc.reject 2026-04-22 16:19:58.260524568 +0300 @@ -30,10 +30,6 @@ sys_guid() != sys_guid() 1 explain extended select uuid() = "", sys_guid() = ""; -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 uuid() = '' AS `uuid() = ""`,sys_guid() = '' AS `sys_guid() = ""` set @a= uuid_short(); set @b= uuid_short(); select @b - @a; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_misc/' main.plugin_load [ pass ] 5 main.plugin_load_option [ pass ] 4 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:20:21 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-22 16:20:21.330214726 +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 ] 2101 main.ctype_utf8mb4_0900_ai_ci_casefold [ pass ] 2052 main.ctype_utf8mb4_general1400_as_ci_casefold [ pass ] 2018 main.ctype_utf8mb4_general_ci_casefold [ pass ] 2143 main.ctype_utf8mb4_general_ci_ws [ pass ] 1818 main.ctype_utf8mb4_turkish_ci_casefold [ pass ] 2043 main.ctype_utf8mb4_uca1400_ai_ci_casefold [ pass ] 2063 main.ctype_utf8mb4_unicode_520_ci_casefold [ pass ] 2051 main.ctype_utf8mb4_unicode_ci_casefold [ pass ] 2051 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:21:30 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-22 16:21:30.264239579 +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 @@ -2995,7 +2997,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 250 +Handler_read_key 257 Handler_read_last 0 Handler_read_next 249 Handler_read_prev 0 @@ -3014,7 +3016,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 250 +Handler_read_key 257 Handler_read_last 0 Handler_read_next 249 Handler_read_prev 0 @@ -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_general_ci_ws main.ctype_utf8mb4_uca1400_ai_ci_casefold main.ctype_utf8mb4_general_ci_casefold main.ctype_utf8mb4_0900_ai_ci_casefold main.ctype_utf8mb4_unicode_ci_casefold main.ctype_utf8mb4_general1400_as_ci_casefold main.order_by main.analyze_format_json main.ctype_utf8mb4_unicode_520_ci_casefold main.ctype_utf8mb4_turkish_ci_casefold 2026-04-22 16:21:28 41 [ERROR] mariadbd: Out of sort memory, consider increasing server sort buffer size ReplayTest: Loading context main.rowid_filter_myisam_debug [ pass ] 112 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:21:41 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-22 16:21:41.742239184 +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,6 @@ 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` # 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 +2579,6 @@ 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` 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 +2591,6 @@ (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` drop function f1; drop function f2; drop table t1,t2,t3,t4; @@ -2920,7 +2895,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 +2912,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 ReplayTest: Loading context main.opt_context_replay_basic [ fail ] Test ended at 2026-04-22 16:21:47 CURRENT_TEST: main.opt_context_replay_basic --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/opt_context_replay_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_replay_basic.reject 2026-04-22 16:21:47.237187000 +0300 @@ -122,6 +122,9 @@ Warnings: Note 1007 Can't create database 'db1'; database exists USE db1; +DROP TABLE IF EXISTS db1.t1; +Warnings: +Note 1051 Unknown table 'db1.t1' CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, Result length mismatch - 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 ] 14621 ReplayTest: Loading context main.error_simulation [ pass ] 94 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.selectivity_notembedded [ fail ] Test ended at 2026-04-22 16:22:22 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-22 16:22:22.732077057 +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 ] 24 main.analyze_format_json_timings [ pass ] 122 main.order_by_pack_big [ pass ] 15256 ReplayTest: Loading context main.a1 [ pass ] 21 ReplayTest: Loading context ReplayTest: Loading context 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 ] 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 main.cset_narrowing [ fail ] Test ended at 2026-04-22 16:23:05 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-22 16:23:05.096471046 +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 ] 709 main.ctype_ucs2_general_ci_ws [ pass ] 236 main.ctype_ucs2_general_mysql500_ci_casefold [ pass ] 700 main.ctype_ucs2_general_mysql500_ci_ws [ pass ] 247 main.ctype_ucs2_turkish_ci_casefold [ pass ] 723 main.ctype_ucs2_unicode_520_ci_casefold [ pass ] 739 main.ctype_utf8mb3_general_ci_casefold [ pass ] 723 main.ctype_utf8mb3_general_ci_ws [ pass ] 209 main.ctype_utf8mb3_general_mysql500_ci_casefold [ pass ] 721 main.ctype_utf8mb3_general_mysql500_ci_ws [ pass ] 215 main.ctype_utf8mb3_turkish_ci_casefold [ pass ] 792 main.ctype_utf8mb3_unicode_520_ci_casefold [ pass ] 759 main.ctype_utf8mb4_general1400_as_ci_ws [ pass ] 2975 main.delete_returning [ 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: Query failed on replay server: 1305 FUNCTION test.f1 does not exist ReplayTest: Failed query was: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW test.v9 AS select `f`.`c1` AS `c1`,`f`.`c2` AS `c2`,`f`.`c3` AS `c3` from (select `test`.`t1`.`c1` AS `c1`,`f1`(`test`.`t1`.`c2`) AS `f1(c2)`,sum(`test`.`t1`.`c3`) AS `sum(c3)` from `test`.`t1` group by `test`.`t1`.`c1`,`f1`(`test`.`t1`.`c2`)) `f`(`c1`,`c2`,`c3`) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:23:55 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-22 16:23:55.563789538 +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 failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: 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 ) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.derived_cond_pushdown [ fail ] Test ended at 2026-04-22 16:24:12 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-22 16:24:12.369078041 +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,6 @@ 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" - } - } - ] - } - } - } - } - ] - } -} DROP VIEW v; DROP TABLE t; # @@ -9866,64 +9769,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 +9786,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 +9798,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 +9810,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 +9824,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 +9836,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 +9848,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 +9860,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 +9874,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 +10158,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 +10167,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 +10179,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 +10188,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 +10200,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 +10215,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 +10231,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 +10252,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 +10285,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 +10295,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 +10318,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 +10328,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 +10380,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 +10393,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 +10422,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 +10435,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 +10463,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 +10476,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 +10504,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 +10517,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 +10555,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 +10574,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 +10592,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 +10610,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 +10648,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 +10665,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 +10745,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 +10753,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 +10764,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 +10797,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 +10816,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 +10835,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 +10854,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 +10886,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 +10910,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 +10933,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 +10942,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 +10974,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 +11033,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 +11070,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 +11080,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 +11114,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 +11135,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 +11149,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 +11188,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 +11199,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 +11209,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 +11221,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 +11234,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 +11248,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 +11267,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 +11308,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 +11371,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 +11382,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 +11404,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 +11417,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 +11429,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 +11445,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 +11458,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 +11474,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 +11493,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 +11531,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 +11591,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 +11602,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 +11623,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 +11647,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 +11669,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 +11693,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 +11715,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 +11735,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 +11758,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 +11781,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 +11804,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 +11824,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 +11844,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 +11866,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 +11889,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 +11920,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 +11942,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 +11964,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 +12009,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 +12070,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 +12077,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 +12096,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 +12168,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 +12177,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 +12212,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 +12252,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 +12292,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 +12352,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 +12410,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 +12466,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 +12509,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 +12535,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 +12561,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 +12587,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 +12625,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 +12707,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 +12747,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 +13069,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 +13108,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 +13151,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 +13165,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 +13189,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 +13231,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 +13247,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 +13307,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 +13335,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 +13386,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 +13417,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 +13627,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 +13637,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 +13743,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 +13750,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 +13766,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 +13887,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 +13905,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 +13951,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 +14001,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 +14019,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 +14067,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 +14126,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 +14144,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 +14165,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 +14206,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 +14236,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 +14336,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 19011 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=19011 --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 937723 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: 19011 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 937723) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'a' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(c) VALUES ('r') ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'a' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(c) VALUES ('r') ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:24:36 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-22 16:24:36.375663150 +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 @@ -91,7 +91,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 3 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -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 @@ -180,7 +180,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 3 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -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 @@ -250,7 +250,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 11 +Handler_read_key 17 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -326,7 +326,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 22 +Handler_read_key 25 Handler_read_last 0 Handler_read_next 22 Handler_read_prev 0 @@ -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 @@ -361,7 +361,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 11 +Handler_read_key 17 Handler_read_last 0 Handler_read_next 3 Handler_read_prev 0 @@ -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 @@ -674,7 +674,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 5 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -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; # @@ -1705,10 +1705,6 @@ set optimizer_switch='derived_merge=off'; 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 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used SELECT * FROM (SELECT * FROM (SELECT @b) AS t) AS s; @b NULL @@ -1973,11 +1969,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 +1979,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); @@ -2429,10 +2415,6 @@ FROM INFORMATION_SCHEMA.STATISTICS GROUP BY TABLE_SCHEMA) AS UNIQUES ON ( COLUMNS.TABLE_SCHEMA = UNIQUES.TABLE_SCHEMA); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY COLUMNS ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases -1 PRIMARY ref key0 key0 194 information_schema.COLUMNS.TABLE_SCHEMA 1 -2 DERIVED STATISTICS ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.COLUMNS INNER JOIN @@ -3030,7 +3012,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 29 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 @@ -3050,7 +3032,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 21 +Handler_read_key 29 Handler_read_last 0 Handler_read_next 6 Handler_read_prev 0 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 ] 1076 ReplayTest: Loading context main.distinct_notembedded [ fail ] Test ended at 2026-04-22 16:24:48 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-22 16:24:48.659322376 +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 ] 66 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1050 Table 'seq_1_to_100' already exists ReplayTest: Failed query was: CREATE TABLE `seq_1_to_100` ( `seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`) ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:24:54 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-22 16:24:54.258046997 +0300 @@ -573,46 +573,8 @@ } } explain format=json insert into t0 values (1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t0" - } - } -} 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 - } - } - ] - } - } - ] - } -} drop table t1; # # A derived table @@ -798,76 +760,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 ] 425 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 ] 1548 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.func_str [ fail ] Test ended at 2026-04-22 16:25:06 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-22 16:25:05.822516125 +0300 @@ -839,240 +839,52 @@ substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2) substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2) 1abcd;2abcd 3abcd;4abcd explain extended select md5('hello'); -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 md5('hello') AS `md5('hello')` explain extended select sha('abc'); -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 sha('abc') AS `sha('abc')` explain extended select sha1('abc'); -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 sha('abc') AS `sha1('abc')` explain extended select soundex(''); -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 soundex('') AS `soundex('')` explain extended select 'mood' sounds like 'mud'; -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 soundex('mood') = soundex('mud') AS `'mood' sounds like 'mud'` explain extended select aes_decrypt(aes_encrypt('abc','1'),'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 No tables used -Warnings: -Note 1003 select aes_decrypt(aes_encrypt('abc','1'),'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')` explain extended select concat('*',space(5),'*'); -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('*',space(5),'*') AS `concat('*',space(5),'*')` explain extended select reverse('abc'); -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 reverse('abc') AS `reverse('abc')` explain extended select rpad('a',4,'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 No tables used -Warnings: -Note 1003 select rpad('a',4,'1') AS `rpad('a',4,'1')` explain extended select lpad('a',4,'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 No tables used -Warnings: -Note 1003 select lpad('a',4,'1') AS `lpad('a',4,'1')` explain extended select rpad('a',4); -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 rpad('a',4) AS `rpad('a',4)` explain extended select lpad('a',4); -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 lpad('a',4) AS `lpad('a',4)` explain extended select concat_ws(',','',NULL,'a'); -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_ws(',','',NULL,'a') AS `concat_ws(',','',NULL,'a')` explain extended select make_set(255,_latin2'a', _latin2'b', _latin2'c'); -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 make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a', _latin2'b', _latin2'c')` explain extended select elt(2,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 No tables used -Warnings: -Note 1003 select elt(2,1) AS `elt(2,1)` explain extended select locate("a","b",2); -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 locate('a','b',2) AS `locate("a","b",2)` explain extended select format(130,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 No tables used -Warnings: -Note 1003 select format(130,10) AS `format(130,10)` explain extended select char(0); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select char(0) AS `char(0)` explain extended select conv(130,16,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 No tables used -Warnings: -Note 1003 select conv(130,16,10) AS `conv(130,16,10)` explain extended select hex(130); -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 hex(130) AS `hex(130)` explain extended select binary 'HE'; -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 cast('HE' as char charset binary) AS `binary 'HE'` explain extended select export_set(255,_latin2'y', _latin2'n', _latin2' '); -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 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 -Warnings: -Note 1003 select find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B', _latin1'a,b,c,d')` explain extended select collation(conv(130,16,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 No tables used -Warnings: -Note 1003 select collation(conv(130,16,10)) AS `collation(conv(130,16,10))` explain extended select coercibility(conv(130,16,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 No tables used -Warnings: -Note 1003 select coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))` explain extended select length('\n\t\r\b\0\_\%\\'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select octet_length('\n\t\r\b\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')` explain extended select bit_length('\n\t\r\b\0\_\%\\'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select bit_length('\n\t\r\b\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')` explain extended select bit_length('\n\t\r\b\0\_\%\\'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select bit_length('\n\t\r\b\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')` explain extended select concat('monty',' was here ','again'); -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('monty',' was here ','again') AS `concat('monty',' was here ','again')` explain extended select length('hello'); -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 octet_length('hello') AS `length('hello')` explain extended select char(ascii('h')); -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 char(ascii('h')) AS `char(ascii('h'))` explain extended select ord('h'); -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 ord('h') AS `ord('h')` explain extended select quote(1/0); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select quote(1 / 0) AS `quote(1/0)` explain extended select crc32("123"); -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 crc32('123') AS `crc32("123")` explain extended select replace('aaaa','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 replace('aaaa','a','b') AS `replace('aaaa','a','b')` explain extended select insert('txs',2,1,'hi'); -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 insert('txs',2,1,'hi') AS `insert('txs',2,1,'hi')` explain extended select left(_latin2'a',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 No tables used -Warnings: -Note 1003 select left(_latin2'a',1) AS `left(_latin2'a',1)` explain extended select right(_latin2'a',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 No tables used -Warnings: -Note 1003 select right(_latin2'a',1) AS `right(_latin2'a',1)` explain extended select lcase(_latin2'a'); -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 lcase(_latin2'a') AS `lcase(_latin2'a')` explain extended select ucase(_latin2'a'); -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 ucase(_latin2'a') AS `ucase(_latin2'a')` explain extended select SUBSTR('abcdefg',3,2); -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 substr('abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)` explain extended select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2); -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 substring_index('1abcd;2abcd;3abcd;4abcd',';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)` explain extended select trim(_latin2' a '); -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 trim(_latin2' a ') AS `trim(_latin2' a ')` explain extended select ltrim(_latin2' a '); -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 ltrim(_latin2' a ') AS `ltrim(_latin2' a ')` explain extended select rtrim(_latin2' a '); -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 rtrim(_latin2' a ') AS `rtrim(_latin2' a ')` explain extended select decode(encode(repeat("a",100000),"monty"),"monty"); -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 decode(encode(repeat('a',100000),'monty'),'monty') AS `decode(encode(repeat("a",100000),"monty"),"monty")` SELECT lpad(12345, 5, "#"); lpad(12345, 5, "#") 12345 @@ -4815,20 +4627,8 @@ # MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1) # EXPLAIN EXTENDED SELECT CHAR(0xDF USING 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 char(0xdf using latin1) AS `CHAR(0xDF USING latin1)` EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`); -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 char(0xdf) AS `CHAR(0xDF USING ``binary``)` EXPLAIN EXTENDED SELECT CHAR(0xDF); -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 char(0xdf) AS `CHAR(0xDF)` # # MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data # @@ -5118,10 +4918,6 @@ LENGTHB('a') LENGTHB(_utf8 0xC39F) LENGTHB(123) LENGTH(null) 1 2 3 NULL EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('a'); -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 octet_length('a') AS `LENGTH('a')`,octet_length('a') AS `LENGTHB('a')` # # MDEV-13555 Assertion `!item->null_value' failed in Type_handler::Item_send_str # @@ -5806,10 +5602,6 @@ CAST(1 AS BINARY) AS c, CONVERT('a' USING binary), BINARY'a'; -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 cast(1 as char charset binary) AS `c`,convert('a' using binary) AS `CONVERT('a' USING binary)`,cast('a' as char charset binary) AS `BINARY'a'` SELECT coercibility(collation('a')), coercibility(charset('a')), @@ -5829,48 +5621,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 +5685,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-22 16:25:11 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-22 16:25:11.150476890 +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-22 16:25:10 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-22 16:25: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-22 16:25:15.153447550 +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 ] 218 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.insert_returning [ fail ] Test ended at 2026-04-22 16:25:20 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-22 16:25:20.604407779 +0300 @@ -58,23 +58,8 @@ 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 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') EXPLAIN FORMAT="json" INSERT INTO t1(id1,val1) VALUES (10,'k') RETURNING id1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} SELECT * FROM t1; id1 val1 1 a @@ -148,23 +133,8 @@ 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 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') EXPLAIN FORMAT="json" INSERT INTO t1 VALUES(19,'u'),(20,'v') RETURNING id1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} SELECT * FROM t1; id1 val1 1 a @@ -234,25 +204,10 @@ 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 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' 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" - } - } -} 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 +276,8 @@ 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 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') EXPLAIN FORMAT="json" INSERT INTO t1 SET id1=11, val1='k' RETURNING val1; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "table_name": "t1" - } - } -} 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-22 16:25:28 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-22 16:25:27.950354524 +0300 @@ -862,14 +862,14 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 18 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 @@ -1292,7 +1292,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 11 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Result length 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-22 16:25:33 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-22 16:25:33.409315201 +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 ] 549 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1750 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1961 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1050 Table 'seq_1_to_10' already exists ReplayTest: Failed query was: CREATE TABLE `seq_1_to_10` ( `seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`) ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci main.key [ fail ] Test ended at 2026-04-22 16:25:50 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-22 16:25:49.909197613 +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 ] 199 main.max_session_mem_used [ 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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context main.myisam_explain_non_select_all [ fail ] Test ended at 2026-04-22 16:26:04 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-22 16:26:04.550094828 +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,14 +30,15 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd_next 4 Handler_update 3 @@ -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,15 +73,16 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value Handler_delete 3 -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd_next 4 DROP TABLE t1; @@ -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,15 +116,16 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd_next 4 DROP TABLE t1; @@ -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,14 +164,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 8 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 8 Handler_update 1 @@ -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,14 +214,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 8 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 12 Handler_update 1 @@ -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,14 +262,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 5 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd 3 Handler_read_rnd_next 9 Handler_update 3 @@ -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,14 +313,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 8 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 7 Handler_update 2 @@ -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,14 +370,15 @@ 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 +Handler_read_key 15 Handler_read_rnd_next 1014 # Status of testing query execution: Variable_name Value -Handler_read_key 9 +Handler_read_key 15 Handler_read_rnd_next 1019 Handler_update 2 @@ -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,14 +420,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 8 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd 3 Handler_read_rnd_deleted 1 Handler_read_rnd_next 24 @@ -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,15 +473,15 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 5 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd 3 Handler_read_rnd_next 9 Handler_update 3 @@ -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,14 +524,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 8 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 16 Handler_update 2 @@ -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,15 +567,16 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 2 # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd_next 2 DROP TABLE t1; @@ -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,13 +610,14 @@ 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 +Handler_read_key 4 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 DROP TABLE t1; #13 @@ -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,13 +650,14 @@ 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 +Handler_read_key 4 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 DROP TABLE t1; #14 @@ -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,14 +690,15 @@ 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 +Handler_read_key 11 # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 6 +Handler_read_key 11 DROP TABLE t1; #15 @@ -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,13 +731,14 @@ 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 +Handler_read_key 11 # Status of testing query execution: Variable_name Value -Handler_read_key 6 +Handler_read_key 11 DROP TABLE t1; #16 @@ -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,15 +770,15 @@ 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 +Handler_read_key 6 Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value -Handler_read_key 3 +Handler_read_key 6 INSERT INTO t1 VALUES (1), (2), (3), (-1), (-2), (-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,15 +808,16 @@ 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 +Handler_read_key 7 Handler_read_next 3 # Status of testing query execution: Variable_name Value Handler_delete 3 -Handler_read_key 4 +Handler_read_key 7 Handler_read_next 3 DROP TABLE t1; @@ -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,16 +851,17 @@ 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 -Handler_read_key 3 +Handler_read_key 6 # Status of testing query execution: Variable_name Value Handler_delete 1 Handler_read_first 1 -Handler_read_key 3 +Handler_read_key 6 DROP TABLE t1; #18 @@ -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,10 +895,11 @@ 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 +Handler_read_key 14 Handler_read_rnd_next 11 Sort_priority_queue_sorts 1 Sort_rows 1 @@ -870,7 +907,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 7 +Handler_read_key 14 Handler_read_rnd 1 Handler_read_rnd_next 11 Sort_rows 10 @@ -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,16 +954,17 @@ 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 +Handler_read_key 32 Handler_read_next 3 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value Handler_delete 8 -Handler_read_key 19 +Handler_read_key 32 Handler_read_next 3 Handler_read_rnd 5 Handler_read_rnd_deleted 1 @@ -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,14 +1006,15 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 9 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 10 Handler_update 3 @@ -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,15 +1055,16 @@ 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 +Handler_read_key 13 Handler_read_rnd_next 30 # Status of testing query execution: Variable_name Value Handler_delete 3 -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 30 SET @@optimizer_switch= @save_optimizer_switch; @@ -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,15 +1100,16 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 12 # Status of testing query execution: Variable_name Value Handler_delete 3 -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 30 DROP TABLE t1, t2; @@ -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,14 +1143,15 @@ 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 +Handler_read_key 6 Handler_read_rnd_next 6 # Status of testing query execution: Variable_name Value -Handler_read_key 3 +Handler_read_key 6 Handler_read_rnd_next 6 Handler_update 5 @@ -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,14 +1186,15 @@ 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 +Handler_read_key 6 Handler_read_rnd_next 6 # Status of testing query execution: Variable_name Value -Handler_read_key 3 +Handler_read_key 6 DROP TABLE t1; #24 @@ -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,17 +1232,18 @@ 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 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 # Status of testing query execution: Variable_name Value Handler_delete 5 Handler_read_first 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 DROP TABLE t1, t2; @@ -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,14 +1278,15 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 4 Handler_write 3 @@ -1247,18 +1300,13 @@ # select: SELECT * FROM t1 # 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 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 -Warnings: -Note 1003 replace 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_rnd_next 1 FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; @@ -1268,10 +1316,11 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value @@ -1287,18 +1336,13 @@ # select: # EXPLAIN INSERT INTO t1 SET i = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO t1 SET i = 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`(i) values (10) # 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 @@ -1312,18 +1356,13 @@ # select: # EXPLAIN REPLACE INTO t1 SET i = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED REPLACE INTO t1 SET i = 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 replace into `test`.`t1`(i) values (10) # 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 +1390,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,15 +1401,16 @@ 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 +Handler_read_key 9 Handler_read_next 4 # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 5 +Handler_read_key 9 Handler_read_next 4 DROP TABLE t1; @@ -1399,7 +1440,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,10 +1455,11 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 5 @@ -1424,7 +1467,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd 5 Handler_read_rnd_next 27 Sort_rows 8 @@ -1460,7 +1503,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,10 +1518,11 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 5 @@ -1485,7 +1530,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd 5 Handler_read_rnd_next 27 Sort_rows 8 @@ -1515,7 +1560,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,17 +1571,18 @@ 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 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 26 # Status of testing query execution: Variable_name Value Handler_delete 1 Handler_read_first 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 26 DROP TABLE t1, t2; @@ -1563,7 +1610,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,17 +1621,18 @@ 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 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 # Status of testing query execution: Variable_name Value Handler_delete 5 Handler_read_first 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 DROP TABLE t1, t2; @@ -1613,7 +1662,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,10 +1674,11 @@ 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 +Handler_read_key 16 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 1 @@ -1635,7 +1686,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_rows 1 @@ -1669,7 +1720,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,10 +1732,11 @@ 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 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 @@ -1692,7 +1745,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_rows 1 @@ -1723,7 +1776,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,10 +1787,11 @@ 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 +Handler_read_key 14 Handler_read_next 7 Handler_read_rnd 4 Sort_range 1 @@ -1744,7 +1799,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 4 -Handler_read_key 8 +Handler_read_key 14 Handler_read_next 7 Handler_read_rnd 8 Sort_range 1 @@ -1774,7 +1829,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,15 +1840,16 @@ 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 +Handler_read_key 9 Handler_read_prev 4 # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 5 +Handler_read_key 9 Handler_read_prev 4 DROP TABLE t1, t2; @@ -1819,7 +1876,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,10 +1887,11 @@ 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 +Handler_read_key 12 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 5 @@ -1840,7 +1899,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 6 +Handler_read_key 12 Handler_read_rnd 5 Handler_read_rnd_next 27 Sort_rows 26 @@ -1871,7 +1930,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,16 +1941,17 @@ 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 +Handler_read_key 12 Handler_read_last 1 Handler_read_prev 4 # Status of testing query execution: Variable_name Value Handler_delete 5 -Handler_read_key 6 +Handler_read_key 12 Handler_read_last 1 Handler_read_prev 4 @@ -1918,7 +1979,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,14 +1990,15 @@ 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 +Handler_read_key 9 Handler_read_next 4 # Status of testing query execution: Variable_name Value -Handler_read_key 5 +Handler_read_key 9 Handler_read_next 4 Handler_read_rnd 5 Handler_update 5 @@ -1969,7 +2032,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,17 +2047,18 @@ 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 +Handler_read_key 8 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 5 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd 5 Handler_read_rnd_next 27 Handler_update 5 @@ -2025,7 +2090,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,16 +2101,17 @@ 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 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 26 # Status of testing query execution: Variable_name Value Handler_read_first 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 26 Handler_read_rnd 1 Handler_update 1 @@ -2074,7 +2141,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,16 +2152,17 @@ 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 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 # Status of testing query execution: Variable_name Value Handler_read_first 1 -Handler_read_key 8 +Handler_read_key 16 Handler_read_next 4 Handler_read_rnd 5 Handler_update 5 @@ -2125,7 +2194,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,17 +2206,18 @@ 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 +Handler_read_key 16 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 1 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 8 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 @@ -2181,7 +2252,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,10 +2264,11 @@ 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 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 @@ -2203,7 +2276,7 @@ Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 8 +Handler_read_key 16 Handler_read_rnd 1 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 @@ -2235,7 +2308,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,17 +2319,18 @@ 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 +Handler_read_key 14 Handler_read_next 7 Handler_read_rnd 4 Sort_range 1 Sort_rows 4 # Status of testing query execution: Variable_name Value -Handler_read_key 8 +Handler_read_key 14 Handler_read_next 7 Handler_read_rnd 8 Handler_update 4 @@ -2286,7 +2361,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,14 +2372,15 @@ 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 +Handler_read_key 9 Handler_read_prev 4 # Status of testing query execution: Variable_name Value -Handler_read_key 5 +Handler_read_key 9 Handler_read_prev 4 Handler_read_rnd 5 Handler_update 5 @@ -2332,7 +2409,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,17 +2420,18 @@ 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 +Handler_read_key 12 Handler_read_rnd_next 27 Sort_priority_queue_sorts 1 Sort_rows 5 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 6 +Handler_read_key 12 Handler_read_rnd 5 Handler_read_rnd_next 27 Handler_update 4 @@ -2385,7 +2464,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,15 +2475,16 @@ 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 +Handler_read_key 12 Handler_read_last 1 Handler_read_prev 4 # Status of testing query execution: Variable_name Value -Handler_read_key 6 +Handler_read_key 12 Handler_read_last 1 Handler_read_prev 4 Handler_read_rnd 5 @@ -2435,7 +2516,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,17 +2527,18 @@ 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 +Handler_read_key 13 Handler_read_next 2 Sort_priority_queue_sorts 1 Sort_range 1 Sort_rows 2 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 13 Handler_read_next 2 Handler_read_rnd 2 Handler_update 2 @@ -2479,7 +2562,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,10 +2573,11 @@ 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 +Handler_read_key 13 Handler_read_next 2 Sort_priority_queue_sorts 1 Sort_range 1 @@ -2500,7 +2585,7 @@ # Status of testing query execution: Variable_name Value Handler_delete 2 -Handler_read_key 7 +Handler_read_key 13 Handler_read_next 2 Handler_read_rnd 2 Sort_range 1 @@ -2526,7 +2611,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,14 +2622,15 @@ 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 +Handler_read_key 7 Handler_read_next 2 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 7 Handler_read_next 2 Handler_read_rnd 2 Handler_update 2 @@ -2571,8 +2658,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,15 +2670,15 @@ 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 +Handler_read_key 14 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 14 Handler_read_rnd_next 4 # @@ -2612,8 +2699,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,15 +2711,15 @@ 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 +Handler_read_key 14 Handler_read_rnd_next 4 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 14 Handler_read_rnd_next 4 DROP TABLE t1, t2; @@ -2661,7 +2748,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,15 +2761,16 @@ 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 +Handler_read_key 18 Handler_read_next 2 Handler_read_rnd_next 3 # Status of testing query execution: Variable_name Value -Handler_read_key 9 +Handler_read_key 16 Handler_read_next 2 Handler_read_rnd_next 3 Handler_update 2 @@ -2729,10 +2818,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,17 +2830,18 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 6 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd 1 Handler_read_rnd_deleted 1 Handler_read_rnd_next 8 @@ -2772,10 +2863,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,17 +2876,18 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 9 # Status of testing query execution: Variable_name Value -Handler_read_key 2 +Handler_read_key 4 Handler_read_rnd 2 Handler_read_rnd_deleted 1 Handler_read_rnd_next 18 @@ -2822,7 +2915,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,17 +2926,18 @@ 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 -Handler_read_key 3 +Handler_read_key 6 Handler_read_next 3 # Status of testing query execution: Variable_name Value Handler_delete 3 Handler_read_first 1 -Handler_read_key 3 +Handler_read_key 6 Handler_read_next 3 DROP TABLE t1; @@ -2871,7 +2966,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,15 +2978,16 @@ 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 +Handler_read_key 16 Handler_read_rnd_next 5 # Status of testing query execution: Variable_name Value Handler_delete 4 -Handler_read_key 10 +Handler_read_key 16 Handler_read_rnd 4 Handler_read_rnd_next 10 @@ -2920,7 +3017,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,15 +3029,16 @@ 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 +Handler_read_key 16 Handler_read_rnd_next 5 # Status of testing query execution: Variable_name Value Handler_delete 4 -Handler_read_key 10 +Handler_read_key 16 Handler_read_rnd 4 Handler_read_rnd_next 10 @@ -2953,27 +3052,19 @@ # 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 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) # 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; -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` # 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 +3095,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,15 +3106,15 @@ 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 +Handler_read_key 4 Handler_read_rnd_next 1 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 8 Handler_read_rnd_next 1 DROP TABLE t1, t2; @@ -3031,8 +3122,6 @@ #68 CREATE TABLE t1 (i INT); EXPLAIN INSERT DELAYED INTO t1 VALUES (1); -id select_type table type possible_keys key key_len ref rows Extra -1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL DROP TABLE t1; #69 CREATE TABLE t1 (a INT); @@ -3059,7 +3148,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,17 +3161,18 @@ 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 +Handler_read_key 11 Handler_read_rnd_next 8 Sort_priority_queue_sorts 1 Sort_rows 3 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 11 Handler_read_rnd_next 8 Handler_update 1 Sort_priority_queue_sorts 1 @@ -3110,7 +3201,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,17 +3215,18 @@ 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 +Handler_read_key 11 Handler_read_rnd_next 8 Sort_priority_queue_sorts 1 Sort_rows 3 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 11 Handler_read_rnd_next 8 Sort_priority_queue_sorts 1 Sort_rows 3 @@ -3163,7 +3256,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,17 +3270,18 @@ 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 +Handler_read_key 11 Handler_read_rnd_next 8 Sort_priority_queue_sorts 1 Sort_rows 3 Sort_scan 1 # Status of testing query execution: Variable_name Value -Handler_read_key 7 +Handler_read_key 11 Handler_read_rnd_next 8 Sort_priority_queue_sorts 1 Sort_rows 3 @@ -3239,7 +3334,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,13 +3345,14 @@ 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 +Handler_read_key 7 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 7 # used key is modified & Using filesort # @@ -3274,7 +3371,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,14 +3382,15 @@ 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 +Handler_read_key 7 Sort_range 1 # Status of testing query execution: Variable_name Value -Handler_read_key 4 +Handler_read_key 7 Sort_range 1 DROP TABLE t1; @@ -3302,18 +3401,13 @@ # 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 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`) # 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,10 +3435,11 @@ 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 +Handler_read_key 14 Handler_read_rnd 1 Handler_read_rnd_next 5 Handler_write 4 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 ] 826 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 504 main.natural_sort_key [ pass ] 550 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 532 ReplayTest: Loading context main.opt_context_load_stats_basic [ pass ] 119 ReplayTest: Loading context main.opt_context_store_stats [ pass ] 125 ReplayTest: Loading context main.opt_hint_timeout [ pass ] 1025 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:26:35 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-22 16:26:35.796880161 +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'; @@ -285,7 +289,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 0 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -310,7 +314,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 10 Handler_read_prev 0 @@ -510,38 +514,18 @@ # Make sure ICP is expected to be used when there are no hints 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) -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)) # 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) -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)) # 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) -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)) # 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) -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)) # Misc tests # Should issue warning EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) QB_NAME(qb1 ) */ * FROM t2; @@ -659,7 +643,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 10 Handler_read_prev 0 @@ -684,7 +668,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 10 Handler_read_prev 0 @@ -708,7 +692,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 10 +Handler_read_key 20 Handler_read_last 0 Handler_read_next 10 Handler_read_prev 0 @@ -744,7 +728,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 8 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -761,7 +745,7 @@ SHOW STATUS LIKE 'handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 8 Handler_read_last 0 Handler_read_next 2 Handler_read_prev 0 @@ -1092,35 +1076,13 @@ SELECT /*+ BKA(t1) */ 1 FROM t1; 1 EXPLAIN EXTENDED SELECT /*+ QB_NAME(qb1) */ 1 UNION SELECT /*+ QB_NAME(qb2) */ 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 No tables used -2 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 /*+ QB_NAME(`qb1`) */ 1 AS `1` union /* select#2 */ select /*+ QB_NAME(`qb2`) */ 1 AS `1` EXPLAIN EXTENDED (SELECT /*+ QB_NAME(qb1) */ 1) UNION (SELECT /*+ QB_NAME(qb2) */ 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 No tables used -2 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 /*+ QB_NAME(`qb1`) */ 1 AS `1`) union (/* select#2 */ select /*+ QB_NAME(`qb2`) */ 1 AS `1`) # # test explainable statements for hint support: # they should warn with a hint syntax error near "test */" # EXPLAIN EXTENDED SELECT /*+ test */ 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 No tables used -Warnings: -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) 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 @@ -1187,27 +1149,10 @@ DROP TABLE `test1``test2```; # Valid hints, no warning: EXPLAIN EXTENDED SELECT /*+ QB_NAME(`*`) */ 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 No tables used -Warnings: -Note 1003 select /*+ QB_NAME(`*`) */ 1 AS `1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(`a*`) */ 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 No tables used -Warnings: -Note 1003 select /*+ QB_NAME(`a*`) */ 1 AS `1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(`*b`) */ 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 No tables used -Warnings: -Note 1003 select /*+ QB_NAME(`*b`) */ 1 AS `1` EXPLAIN EXTENDED SELECT /*+ QB_NAME(`a b`) */ 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 No tables used -Warnings: -Note 1003 select /*+ QB_NAME(`a -b`) */ 1 AS `1` # Identifiers starting with digits must be supported: CREATE OR REPLACE TABLE 0a (8a INT, KEY 6a(8a)); EXPLAIN EXTENDED SELECT /*+ NO_MRR(0a 6a) BKA(0a)*/ 8a FROM 0a; @@ -1218,17 +1163,8 @@ DROP TABLE 0a; # hint syntax error: empty quoted identifier EXPLAIN EXTENDED SELECT /*+ QB_NAME(``) */ 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 No tables used -Warnings: -Warning 1064 Optimizer hint syntax error near '``) */ 1' at line 1 -Note 1003 select 1 AS `1` SET NAMES utf8; EXPLAIN EXTENDED SELECT /*+ QB_NAME(`\BF``\BF`) */ 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 No tables used -Warnings: -Note 1003 select /*+ QB_NAME(`\BF``\BF`) */ 1 AS `1` CREATE TABLE tableТ (i INT); # invalid hints, should warn: SELECT /*+ BKA(tableТ) */ 1 FROM t1; 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 ] 806 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 630 main.opt_trace_selectivity [ 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 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:26:49 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-22 16:26:48.978658987 +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-22 16:26:52 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-22 16:26:52.620610941 +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 ] 63 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.range_notembedded [ fail ] Test ended at 2026-04-22 16:26:58 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-22 16:26:57.887641754 +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-22 16:27:06 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-22 16:27:05.888991703 +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%'); @@ -1305,7 +1351,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 2 +Handler_read_key 11 Handler_read_last 0 Handler_read_next 385 Handler_read_prev 0 @@ -1334,7 +1380,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 @@ -1365,7 +1411,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 @@ -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')) @@ -1396,7 +1442,7 @@ SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 1 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 59 Handler_read_prev 0 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-22 16:27:12 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-22 16:27:12.758222781 +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-22 16:27:16 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-22 16:27:16.738893497 +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 ] 997 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.sargable_casefold_notembedded [ fail ] Test ended at 2026-04-22 16:27:23 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-22 16:27:23.273643074 +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 ] 76 main.sp-big [ pass ] 1490 main.sp-row [ pass ] 353 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.stat_tables_flush [ pass ] 105 main.statistics_upgrade [ pass ] 805 main.status_debug [ pass ] 28 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect [ fail ] Test ended at 2026-04-22 16:27:50 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-22 16:27:50.342617404 +0300 @@ -9,36 +9,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -49,14 +28,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -401,7 +372,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 +555,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 +1430,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1524,32 +1490,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 +1512,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 +1591,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 +1623,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 +1636,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 +1710,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 +1824,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 +1845,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 +2349,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 +2518,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 +2885,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 +3010,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 +3018,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 +3066,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 +3098,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 +3460,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 +3468,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 +3587,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 +3608,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 +4072,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 +4107,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 +4241,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 +4248,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 +4271,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 +4291,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 +4369,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 +4390,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 +4410,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 +4429,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 +4447,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 +4790,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 +5484,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 +5500,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 +5507,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 +5522,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 +5541,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 +5781,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 +5796,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 +5848,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 +5857,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 +5900,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 +5912,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 +5932,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 +5951,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 +5999,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 +6017,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 +6148,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 +6399,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 +6457,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 +6485,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 +6496,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 +6558,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 +6567,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 +6584,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 +6604,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 @@ -7038,7 +6626,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 8 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -7052,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 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 @@ -7081,7 +6662,7 @@ 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 @@ -7099,10 +6680,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 +6698,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 +6726,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 +6739,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 +6751,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 +6956,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 +6968,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect4' 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 19011 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=19011 --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 938660 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: 19011 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 938660) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'f2' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(pk) VALUES (1) ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'f2' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t2(pk) VALUES (1) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: EXPLAIN SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect4 [ fail ] Test ended at 2026-04-22 16:28:13 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-22 16:28:13.516246498 +0300 @@ -92,10 +92,6 @@ # file .\item_subselect.cc, line 836 # EXPLAIN SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); -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 -Warnings: -Note 1249 Select 2 was reduced during optimization DESCRIBE SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); 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 @@ -1142,10 +1138,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 +1148,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 +1248,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 +1370,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 +1386,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 +1403,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 +1419,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 +1743,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 +1765,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 +1787,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 +1803,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 +2355,6 @@ 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 SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; x 0 @@ -2470,9 +2452,6 @@ # 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 SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1); 2 IN (SELECT 2 from DUAL WHERE 1 != 1) 0 @@ -2520,24 +2499,10 @@ 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`)) 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 +2515,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 +2553,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 +2593,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 +2621,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 +2629,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 +2667,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 +2691,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 +2699,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 +2787,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 +2909,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 +2921,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 +2929,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 +2948,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 +2970,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 +2981,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 +2991,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 +2999,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 +3008,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 +3030,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 +3106,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 +3136,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 19011 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=19011 --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 938734 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: 19011 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 938734) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1124 ReplayTest: Loading context main.subselect_firstmatch [ pass ] 23 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_exists_to_in [ fail ] Test ended at 2026-04-22 16:28:49 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-22 16:28:49.650025170 +0300 @@ -13,36 +13,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -53,14 +32,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -405,7 +376,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 +559,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 +1434,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1528,32 +1494,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 +1516,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 +1595,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 +1627,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 +1640,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 +1714,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 +1828,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 +1849,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 +2353,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 +2522,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 +2889,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 +3014,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 +3022,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 +3070,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 +3102,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 +3464,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 +3472,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 +3591,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 +3612,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 +4076,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 +4111,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 +4245,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 +4252,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 +4275,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 +4295,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 +4373,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 +4394,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 +4414,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 +4433,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 +4451,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 +4794,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 +5488,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 +5504,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 +5511,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 +5526,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 +5545,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 +5785,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 +5800,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 +5852,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 +5861,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 +5904,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 +5916,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 +5936,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 +5955,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 +6003,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 +6021,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 +6152,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 +6403,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 +6461,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 +6489,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 +6500,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 +6562,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 +6571,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 +6588,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 +6608,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 @@ -7040,7 +6630,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 8 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -7054,13 +6644,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 @@ -7083,7 +6666,7 @@ 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 @@ -7101,10 +6684,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 +6702,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 +6730,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 +6743,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 +6755,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 +6960,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 +6972,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_exists_to_in/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_mat' 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 19011 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=19011 --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 938853 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: 19011 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 938853) ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_mat [ fail ] Test ended at 2026-04-22 16:29:11 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-22 16:29:11.527026121 +0300 @@ -16,36 +16,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -56,14 +35,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -408,7 +379,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 +562,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 +1437,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1531,32 +1497,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 +1519,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 +1598,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 +1630,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 +1643,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 +1717,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 +1831,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 +1852,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 +2356,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 +2525,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 +2892,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 +3017,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 +3025,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 +3073,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 +3105,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 +3467,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 +3475,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 +3594,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 +3615,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 +4079,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 +4114,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 +4248,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 +4255,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 +4278,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 +4298,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 +4376,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 +4397,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 +4417,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 +4436,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 +4454,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 +4797,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 +5491,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 +5507,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 +5514,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 +5529,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 +5548,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 +5788,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 +5803,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 +5855,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 +5864,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 +5907,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 +5919,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 +5939,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 +5958,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 +6006,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 +6024,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 +6155,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 +6406,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 +6464,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 +6492,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 +6503,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 +6565,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 +6574,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 +6591,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 +6611,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 @@ -7036,7 +6633,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 8 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -7050,13 +6647,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 @@ -7079,7 +6669,7 @@ 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 @@ -7097,10 +6687,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 +6705,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 +6733,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 +6746,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 +6758,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 +6963,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 +6975,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_mat/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_opts' 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 19011 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=19011 --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 938921 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: 19011 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 938921) ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_opts [ fail ] Test ended at 2026-04-22 16:29:38 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-22 16:29:38.675089735 +0300 @@ -12,36 +12,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -52,14 +31,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -404,7 +375,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 +558,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 +1433,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1527,32 +1493,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 +1515,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 +1594,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 +1626,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 +1639,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 +1713,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 +1827,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 +1848,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 +2352,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 +2521,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 +2888,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 +3013,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 +3021,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 +3069,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 +3101,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 +3463,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 +3471,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 +3590,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 +3611,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 +4075,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 +4110,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 +4244,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 +4251,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 +4274,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 +4294,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 +4372,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 +4393,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 +4413,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 +4432,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 +4450,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 +4793,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 +5487,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 +5503,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 +5510,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 +5525,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 +5544,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 +5784,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 +5799,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 +5851,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 +5860,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 +5903,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 +5915,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 +5935,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 +5954,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 +6002,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 +6020,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 +6151,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 +6402,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 +6460,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 +6488,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 +6499,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 +6561,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 +6570,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 +6587,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 +6607,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 @@ -7033,7 +6629,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 8 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -7047,13 +6643,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 @@ -7076,7 +6665,7 @@ 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 @@ -7094,10 +6683,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 +6701,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 +6729,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 +6742,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 +6754,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 +6959,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 +6971,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_opts/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_scache' 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 19011 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=19011 --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 938975 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: 19011 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 938975) ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_scache [ fail ] Test ended at 2026-04-22 16:30:00 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-22 16:30:00.624068883 +0300 @@ -15,36 +15,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -55,14 +34,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -407,7 +378,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 +561,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 +1436,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1530,32 +1496,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 +1518,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 +1597,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 +1629,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 +1642,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 +1716,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 +1830,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 +1851,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 +2355,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 +2524,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 +2891,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 +3016,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 +3024,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 +3072,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 +3104,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 +3466,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 +3474,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 +3593,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 +3614,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 +4078,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 +4113,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 +4247,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 +4254,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 +4277,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 +4297,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 +4375,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 +4396,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 +4416,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 +4435,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 +4453,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 +4796,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 +5490,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 +5506,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 +5513,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 +5528,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 +5547,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 +5787,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 +5802,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 +5854,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 +5863,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 +5906,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 +5918,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 +5938,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 +5957,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 +6005,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 +6023,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 +6154,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 +6405,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 +6463,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 +6491,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 +6502,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 +6564,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 +6573,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 +6590,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 +6610,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 @@ -7044,7 +6632,7 @@ 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 @@ -7058,13 +6646,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 @@ -7087,7 +6668,7 @@ 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 @@ -7105,10 +6686,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 +6704,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 +6732,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 +6745,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 +6757,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 +6962,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 +6974,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_scache/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_no_semijoin' 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 19011 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=19011 --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 939068 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: 19011 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 939068) ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 2013 Lost connection to server during query ReplayTest: Failed query was: explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1) ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away ReplayTest: Loading context ReplayTest: Query failed on replay server: 2006 Server has gone away ReplayTest: Failed query was: SET NAMES utf8mb4 ReplayTest: Warning - failed to reset optimizer_replay_context: 2006 Server has gone away main.subselect_no_semijoin [ fail ] Test ended at 2026-04-22 16:30:29 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-22 16:30:29.079313166 +0300 @@ -12,36 +12,15 @@ (select 2) 2 explain extended select (select 2); -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 1249 Select 2 was reduced during optimization -Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) 1 2 explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1249 Select 2 was reduced during optimization -Note 1249 Select 4 was reduced during optimization -Note 1003 /* select#1 */ select 1 AS `(SELECT 1)` union /* select#3 */ select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) 0 explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1249 Select 2 was reduced during optimization -Note 1003 /* select#1 */ select (/* select#3 */ select 0 union /* select#4 */ select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; @@ -52,14 +31,6 @@ SELECT (SELECT a) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY system NULL NULL NULL NULL 1 100.00 -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 1 AS `1` from dual having (/* select#3 */ select 1) = 1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -404,7 +375,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 +558,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 +1433,6 @@ 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`) drop table t1; CREATE TABLE t1 ( ID int(10) unsigned NOT NULL auto_increment, @@ -1527,32 +1493,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 +1515,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 +1594,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 +1626,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 +1639,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 +1713,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 +1827,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 +1848,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 +2352,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 +2521,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 +2888,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 +3013,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 +3021,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 +3069,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 +3101,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 +3463,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 +3471,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 +3590,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 +3611,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 +4075,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 +4110,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 +4244,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 +4251,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 +4274,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 +4294,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 +4372,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 +4393,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 +4413,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 +4432,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 +4450,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 +4793,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 +5487,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 +5503,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 +5510,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 +5525,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 +5544,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 +5784,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 +5799,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 +5851,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 +5860,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 +5903,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 +5915,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 +5935,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 +5954,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 +6002,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 +6020,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 +6151,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 +6402,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 +6460,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 +6488,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 +6499,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 +6561,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 +6570,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 +6587,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 +6607,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 @@ -7033,7 +6629,7 @@ show status like '%Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 8 +Handler_read_key 14 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -7047,13 +6643,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 @@ -7076,7 +6665,7 @@ 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 @@ -7094,10 +6683,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 +6701,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 +6729,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 +6742,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 +6754,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 +6959,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 +6971,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 +7218,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 - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.subselect_no_semijoin/' mysql-test-run: *** WARNING: Replay server unresponsive before test 'main.subselect_partial_match' 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 19011 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=19011 --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 939243 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: 19011 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 939243) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1784 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:31:01 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-22 16:31:00.884270981 +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: Loading context ReplayTest: Loading context ReplayTest: Loading context main.subselect_sj_mat [ fail ] Test ended at 2026-04-22 16:31:09 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-22 16:31:09.627492034 +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,6 @@ 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` # 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 +2593,6 @@ 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` 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 +2605,6 @@ (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` 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: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:31:17 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-22 16:31:17.409591407 +0300 @@ -247,11 +247,6 @@ 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` 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 failed on replay server: 1050 Table 'seq_1_to_1000000' already exists ReplayTest: Failed query was: CREATE TABLE `seq_1_to_1000000` ( `seq` bigint(20) unsigned NOT NULL, PRIMARY KEY (`seq`) ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci main.user_var [ fail ] Test ended at 2026-04-22 16:31:21 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-22 16:31:21.191290709 +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 ] 616 main.vector_subdist [ pass ] 753 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.win [ fail ] Test ended at 2026-04-22 16:31:34 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-22 16:31:34.055418739 +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 @@ -3544,10 +3544,6 @@ SELECT DISTINCT BIT_OR(100) OVER () FROM dual GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP HAVING @A := 'qwerty'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -Warnings: -Warning 1292 Truncated incorrect BOOLEAN value: 'qwerty' SELECT DISTINCT BIT_OR(100) OVER () FROM dual GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP HAVING @A := 'qwerty'; @@ -3558,10 +3554,6 @@ SELECT DISTINCT BIT_OR(100) OVER () FROM dual GROUP BY LEFT('2018-08-24', 100) HAVING @A := 'qwerty'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING -Warnings: -Warning 1292 Truncated incorrect BOOLEAN value: 'qwerty' SELECT DISTINCT BIT_OR(100) OVER () FROM dual GROUP BY LEFT('2018-08-24', 100) HAVING @A := 'qwerty'; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.win/' main.warnings [ pass ] 67 main.skip_log_bin [ pass ] 26 ReplayTest: Loading context main.partition_disabled [ pass ] 37 main.myisam_crash_before_flush_keys [ pass ] 263 main.variables-notembedded [ pass ] 59 main.ssl_system_ca 'bad' [ pass ] 64 main.ssl_8k_key [ pass ] 72 main.ssl_timeout-9836 [ pass ] 2023 main.thread_pool_info [ pass ] 1482 main.ssl_cipher [ pass ] 3348 main.mysql_json_table_recreate [ pass ] 2363 main.mysql_upgrade_mysql_json_with_plugin_loaded [ pass ] 3329 main.lowercase_mixed_tmpdir [ pass ] 21 main.grant_lowercase [ pass ] 62 main.lowercase_view [ pass ] 74 main.lowercase_table [ pass ] 73 main.lowercase_table_grant [ pass ] 12 main.lowercase_table_qcache [ pass ] 17 main.master_retry_count_basic [ pass ] 1524 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.variables [ fail ] Test ended at 2026-04-22 16:33:07 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-22 16:33:07.053871471 +0300 @@ -75,10 +75,6 @@ @t1:=(@t2:=1)+@t3:=4 @t1 @t2 @t3 5 5 1 4 explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; -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 @t1:=(@t2:=1) + (@t3:=4) AS `@t1:=(@t2:=1)+@t3:=4`,@`t1` AS `@t1`,@`t2` AS `@t2`,@`t3` AS `@t3` select @t5; @t5 1.23456 @@ -150,18 +146,10 @@ last_insert_id(345) 345 explain extended select last_insert_id(345); -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 last_insert_id(345) AS `last_insert_id(345)` select @@IDENTITY,last_insert_id(), @@identity; @@IDENTITY last_insert_id() @@identity 345 345 345 explain extended select @@IDENTITY,last_insert_id(), @@identity; -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 @@IDENTITY AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,@@identity AS `@@identity` set global concurrent_insert=2; show variables like 'concurrent_insert'; Variable_name Value @@ -1527,7 +1515,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 @@ -1776,25 +1764,9 @@ SQL_MODE ANSI_QUOTES End of 5.5 tests explain extended select @@VERsion from dual where rand() > @@verSION; -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 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 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 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 # # 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 ] 100 main.count_distinct2 [ pass ] 740 main.multi_update_tiny_hash [ pass ] 19 main.myisam_recover [ pass ] 416 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:33:23 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-22 16:33:23.111314819 +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-22 16:33:23 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-22 16:33:23 4 [ERROR] MariaDB thread id 4, OS thread handle 123422364079808, query id 2982 localhost root Checking table 2026-04-22 16:33:23 4 [ERROR] mariadbd: Table './test/t1' is marked as crashed and should be repaired main.old-mode [ pass ] 73 main.plugin_auth_qa [ pass ] 114 main.plugin_auth_qa_1 [ pass ] 662 main.plugin_auth_qa_2 [ pass ] 455 main.plugin_auth_qa_3 [ pass ] 84 main.plugin_maturity [ pass ] 1 main.handlersocket [ pass ] 16 main.plugin [ pass ] 76 main.plugin_not_embedded [ pass ] 1431 main.truncate_badse [ pass ] 14 main.query_cache_notembedded [ pass ] 6179 main.bug58669 [ pass ] 8 main.require_secure_transport [ pass ] 40 main.require_secure_transport_on [ pass ] 34 main.grant3 [ pass ] 99 main.secure_file_priv_win [ skipped ] Need windows main.skip_grants [ pass ] 4316 main.udf_skip_grants [ pass ] 9 main.flush2 [ pass ] 17 main.mysqldump-no-binlog [ pass ] 46 main.kill-2 [ pass ] 27 main.skip_name_resolve [ pass ] 20 main.my_getopt_case_insensitive [ pass ] 1 main.mysqlslap [ pass ] 3089 main.chained_ssl_certificates [ pass ] 2796 main.ssl_crl 'file' [ pass ] 77 main.ssl_crl 'path' [ pass ] 51 main.wolfssl [ pass ] 2 main.sysdate_is_now [ pass ] 1001 main.no-threads [ pass ] 3 main.shutdown_debug '1tpc' [ pass ] 1569 main.mdev-21101 [ pass ] 3311 main.shutdown_debug 'pot' [ pass ] 1536 main.tls_version [ pass ] 346 main.long_tmpdir [ pass ] 9 main.trans_read_only [ 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 main.selectivity_no_engine [ fail ] Test ended at 2026-04-22 16:35:42 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-22 16:35:42.674523885 +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 ] 2473 main.mysqldump-compat-102 [ pass ] 57 main.analyze_format_json_emb [ skipped ] Test requires: embedded server main.count_distinct3 [ pass ] 12810 main.create_delayed [ pass ] 2013 main.flush_corruption [ pass ] 36064 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'c' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t1() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:37:35 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-22 16:37:35.627617797 +0300 @@ -1239,7 +1239,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 5 +Handler_read_key 13 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 @@ -1804,7 +1804,7 @@ show status like "handler_read%"; Variable_name Value Handler_read_first 0 -Handler_read_key 4 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -1819,7 +1819,7 @@ show status like "handler_read%"; Variable_name Value Handler_read_first 0 -Handler_read_key 4 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -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,6 @@ 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 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 +2366,6 @@ 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 drop function f; drop table t; CREATE TABLE t1 ( @@ -2429,11 +2415,6 @@ 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 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 failed on replay server: 1364 Field 'c' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t1() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:37:53 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-22 16:37:53.157300500 +0300 @@ -1246,7 +1246,7 @@ show status like 'Handler_read%'; Variable_name Value Handler_read_first 0 -Handler_read_key 5 +Handler_read_key 13 Handler_read_last 0 Handler_read_next 9 Handler_read_prev 0 @@ -1811,7 +1811,7 @@ show status like "handler_read%"; Variable_name Value Handler_read_first 0 -Handler_read_key 4 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -1826,7 +1826,7 @@ show status like "handler_read%"; Variable_name Value Handler_read_first 0 -Handler_read_key 4 +Handler_read_key 10 Handler_read_last 0 Handler_read_next 5 Handler_read_prev 0 @@ -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,6 @@ 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 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 +2373,6 @@ 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 drop function f; drop table t; CREATE TABLE t1 ( @@ -2436,11 +2422,6 @@ 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 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 ] 4718 main.myisam-big [ pass ] 3948 main.query_cache_debug [ pass ] 42 main.ssl-big [ pass ] 52653 main.type_newdecimal-big [ pass ] 2705 main.1st [ pass ] 2 main.aborted_clients [ pass ] 7 main.adddate_454 [ pass ] 5 main.alias [ pass ] 36 main.almost_full [ pass ] 33 main.alter_table_combinations 'aria' [ pass ] 73 main.alter_table_combinations 'heap' [ pass ] 40 main.alter_table_debug [ pass ] 12 main.alter_table_locknone_notembedded [ pass ] 31 main.alter_table_mdev539_maria [ pass ] 2249 main.alter_table_mdev539_myisam [ pass ] 887 main.alter_table_upgrade_aria [ pass ] 23 main.alter_table_upgrade_myisam [ pass ] 8 main.alter_table_upgrade_myisam_debug [ pass ] 36 main.alter_user [ pass ] 42 main.analyze_debug [ pass ] 2 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.analyze_stmt [ fail ] Test ended at 2026-04-22 16:40:52 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-22 16:40:52.534504456 +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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.analyze_stmt_privileges2 [ fail ] Test ended at 2026-04-22 16:41:02 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-22 16:41:01.955446352 +0300 @@ -388,8 +388,6 @@ #------------------------------------------------------------------------ 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 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 @@ -402,15 +400,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v1 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 +495,6 @@ #------------------------------------------------------------------------ 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 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 @@ -515,15 +507,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -615,8 +603,6 @@ #------------------------------------------------------------------------ INSERT INTO t1 (a) VALUES (10); EXPLAIN INSERT INTO t1 (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 ANALYZE INSERT INTO t1 (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 @@ -1484,8 +1470,6 @@ #------------------------------------------------------------------------ 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 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 @@ -1498,15 +1482,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v1 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -1599,8 +1579,6 @@ #------------------------------------------------------------------------ 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 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 @@ -1613,15 +1591,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -1721,8 +1695,6 @@ #------------------------------------------------------------------------ INSERT INTO t1 (a) VALUES (10); EXPLAIN INSERT INTO t1 (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 ANALYZE INSERT INTO t1 (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 @@ -1735,15 +1707,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO t1 (a) VALUES (10); EXPLAIN REPLACE INTO t1 (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 ANALYZE REPLACE INTO t1 (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 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 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 @@ -1829,8 +1797,6 @@ #------------------------------------------------------------------------ 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 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 @@ -1843,15 +1809,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v1 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -1943,8 +1905,6 @@ # Note: some queries are commented due to MDEV-7034 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 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 @@ -1957,15 +1917,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -2695,8 +2651,6 @@ #------------------------------------------------------------------------ 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 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 @@ -2709,15 +2663,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -3869,8 +3819,6 @@ #------------------------------------------------------------------------ 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 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 @@ -3883,15 +3831,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v1 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -3982,8 +3926,6 @@ #------------------------------------------------------------------------ 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 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 @@ -3996,15 +3938,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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 @@ -5105,8 +5043,6 @@ #------------------------------------------------------------------------ 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 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 @@ -5119,15 +5055,11 @@ 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00 REPLACE INTO v2 (a) VALUES (10); EXPLAIN REPLACE 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 ANALYZE REPLACE 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 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 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.ansi [ fail ] Test ended at 2026-04-22 16:41:07 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-22 16:41:07.162221353 +0300 @@ -57,15 +57,7 @@ a 18446744073709551596 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 -1 << concat(1,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" SELECT -1+1||1 AS a FROM DUAL; a 10 @@ -73,15 +65,7 @@ a -9 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 -1 + concat(1,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" SELECT 1*1||-1 AS a FROM DUAL; a 1 @@ -91,15 +75,7 @@ a -11 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 1 * concat(1,-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" SELECT -1^1||1 AS a FROM DUAL; a 18446744073709551604 @@ -107,12 +83,4 @@ a 18446744073709551607 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 -1 ^ concat(1,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" 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 ] 109 main.assign_key_cache_debug [ pass ] 1010 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.auto_increment [ fail ] Test ended at 2026-04-22 16:41:15 CURRENT_TEST: main.auto_increment --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/auto_increment.result 2026-04-02 14:38:09.277657862 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/auto_increment.reject 2026-04-22 16:41:15.529128360 +0300 @@ -140,10 +140,6 @@ last_insert_id() 255 explain extended select last_insert_id(); -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 last_insert_id() AS `last_insert_id()` insert into t1 set i = 254; ERROR 23000: Duplicate entry '254' for key 'PRIMARY' select last_insert_id(); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.auto_increment/' set optimizer_record_context=1; main.b1 [ pass ] 1 main.backup_aria [ pass ] 53 main.bad_frm_crash_5029 [ pass ] 3 main.bad_startup_options [ pass ] 2283 main.bad_startup_options_debug [ pass ] 1616 ReplayTest: Loading context main.bench_count_distinct [ pass ] 78 main.bigint [ pass ] 57 ReplayTest: Loading context ReplayTest: Loading context main.binary [ fail ] Test ended at 2026-04-22 16:41:38 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-22 16:41:38.717293855 +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 ] 333 main.blackhole_plugin [ pass ] 5 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.brackets [ fail ] Test ended at 2026-04-22 16:41:46 CURRENT_TEST: main.brackets --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/brackets.result 2026-04-02 14:38:09.280657854 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/brackets.reject 2026-04-22 16:41:46.539261598 +0300 @@ -5,113 +5,45 @@ 3 explain extended select 1 union ( select 2 union select 3); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -4 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` union /* select#4 */ select `__4`.`2` AS `2` from (/* select#2 */ select 2 AS `2` union /* select#3 */ select 3 AS `3`) `__4` select 1 union ( select 1 union select 1); 1 1 explain extended select 1 union ( select 1 union select 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 No tables used -4 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select 1 AS `1` union /* select#4 */ select `__4`.`1` AS `1` from (/* select#2 */ select 1 AS `1` union /* select#3 */ select 1 AS `1`) `__4` select 1 union all ( select 1 union select 1); 1 1 1 explain extended select 1 union all ( select 1 union select 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 No tables used -4 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1 AS `1` union all /* select#4 */ select `__4`.`1` AS `1` from (/* select#2 */ select 1 AS `1` union /* select#3 */ select 1 AS `1`) `__4` select 1 union ( select 1 union all select 1); 1 1 explain extended select 1 union ( select 1 union all select 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 No tables used -4 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1 AS `1` union /* select#4 */ select `__4`.`1` AS `1` from (/* select#2 */ select 1 AS `1` union /* select#3 */ select 1 AS `1`) `__4` select 1 union select 1 union all select 1; 1 1 1 explain extended select 1 union select 1 union all select 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 No tables used -2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -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 1 AS `1` union /* select#2 */ select 1 AS `1` union all /* select#3 */ select 1 AS `1` (select 1 as a) union (select 2) order by a; a 1 2 explain extended (select 1 as a) union (select 2) order 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 No tables used -2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort -Warnings: -Note 1003 (/* select#1 */ select 1 AS `a`) union (/* select#2 */ select 2 AS `2`) order by `a` /* select#1 */ select 1 AS `a` union /* select#2 */ select 2 AS `2` order by `a`; a 1 2 explain extended /* select#1 */ select 1 AS `a` union /* select#2 */ select 2 AS `2` order 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 No tables used -2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Using filesort -Warnings: -Note 1003 /* select#1 */ select 1 AS `a` union /* select#2 */ select 2 AS `2` order by `a` select 1 union ( select 1 union (select 1 union (select 1 union select 1))); 1 1 explain extended all select 1 union ( select 1 union (select 1 union (select 1 union select 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 No tables used -8 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -7 UNION ALL NULL NULL NULL NULL 2 100.00 -3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -6 UNION ALL NULL NULL NULL NULL 2 100.00 -4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used -5 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1/0 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#8/0 */ select `__8`.`1` AS `1` from (/* select#2/1 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#7/1 */ select `__7`.`1` AS `1` from (/* select#3/2 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#6/2 */ select `__6`.`1` AS `1` from (/* select#4/3 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#5/3 */ select 1 AS `1`) `__6`) `__7`) `__8` # # MDEV-6341: INSERT ... SELECT UNION with parenthesis # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.brackets/' main.bug12427262 [ pass ] 25 main.bug13633383 [ pass ] 10 main.bulk_replace [ pass ] 3 main.cache_temporal_4265 [ pass ] 15 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.case [ fail ] Test ended at 2026-04-22 16:41:58 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-22 16:41:57.987214505 +0300 @@ -23,10 +23,6 @@ exp one explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END as exp; -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 case 1 when 1 then 'one' when 2 then 'two' else 'more' end AS `exp` select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END as exp; exp two @@ -151,10 +147,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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.cast [ fail ] Test ended at 2026-04-22 16:42:00 CURRENT_TEST: main.cast --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cast.result 2026-04-02 14:38:09.281657851 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/cast.reject 2026-04-22 16:42:00.566203915 +0300 @@ -30,10 +30,6 @@ ~5 cast(~5 as signed) 18446744073709551610 -6 explain extended select ~5, cast(~5 as signed); -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 ~5 AS `~5`,cast(~5 as signed) AS `cast(~5 as signed)` select cast(18446744073709551615 as signed); cast(18446744073709551615 as signed) -1 @@ -336,20 +332,8 @@ cast(cast(-1.1 as double) as datetime) NULL explain extended select cast(10 as double(5,2)); -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 cast(10 as double(5,2)) AS `cast(10 as double(5,2))` explain extended select cast(10 as double); -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 cast(10 as double) AS `cast(10 as double)` explain extended select cast(10 as decimal(5,2)); -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 cast(10 as decimal(5,2)) AS `cast(10 as decimal(5,2))` select cast('18446744073709551616' as unsigned); cast('18446744073709551616' as unsigned) 18446744073709551615 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.cast/' main.change_user [ pass ] 58 main.change_user_notembedded [ pass ] 5019 main.charset_client_win_utf8mb4 [ skipped ] Need windows main.check [ pass ] 2433 main.check_constraint [ pass ] 63 main.check_constraint_show [ pass ] 6 main.check_view_protocol [ skipped ] Test requires view-protocol main.cli_options_force_protocol_not_win [ pass ] 313 main.client [ pass ] 538 main.client_xml [ pass ] 403 main.column_compression_utf16 [ pass ] 7 main.comment_column [ pass ] 80 main.comment_column2 [ pass ] 53 main.comment_database [ pass ] 1446 main.comment_index [ pass ] 52 main.comment_table [ pass ] 16 main.comments [ pass ] 10 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.compare [ pass ] 136 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'name' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t3(t2nr, period) VALUES (11401, 1001) ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.compress [ fail ] Test ended at 2026-04-22 16:43:03 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-22 16:43:03.064009835 +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 ] 9 main.connect_debug [ pass ] 67 main.constraints [ pass ] 52 main.contributors [ pass ] 1 main.count_distinct [ pass ] 47 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.create [ fail ] Test ended at 2026-04-22 16:43:27 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-22 16:43:27.396851093 +0300 @@ -476,16 +476,6 @@ addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd 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 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.connect_debug main.create main.constraints main.contributors main.connect-no-db 2026-04-22 16:43:22 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-22 16:43:22 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-22 16:43:22 30 [ERROR] Invalid (old?) table or database name 't-1' 2026-04-22 16:43:22 30 [ERROR] Invalid (old?) table or database name 't-1' main.create-uca [ pass ] 49 main.create_drop_db [ pass ] 8 main.create_drop_event [ pass ] 1163 main.create_drop_index [ pass ] 13 main.create_drop_procedure [ pass ] 11 main.create_drop_role [ pass ] 22 main.create_drop_server [ pass ] 10 main.create_drop_trigger [ pass ] 17 main.create_drop_udf [ pass ] 9 main.create_drop_user [ pass ] 31 main.create_drop_view [ pass ] 17 main.create_not_windows [ pass ] 13 main.create_or_replace_permission [ pass ] 7 main.create_replace_tmp [ pass ] 4 main.create_user [ pass ] 51 main.create_utf8 [ pass ] 27 main.create_w_max_indexes_128 [ skipped ] Test needs mysqld built with --with-max-indexes=128 main.create_w_max_indexes_64 [ pass ] 32 main.create_windows [ skipped ] Need windows main.cte_cycle [ pass ] 19 main.cte_grant [ 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: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 1264 main.cte_nonrecursive_not_embedded [ pass ] 11 main.cte_recursive_not_embedded [ 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.cte_update_delete [ fail ] Test ended at 2026-04-22 16:44:25 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-22 16:44:25.005948558 +0300 @@ -597,12 +597,6 @@ 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 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 ] 33 main.ctype_big5 [ pass ] 2582 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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 ] 644 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_collate [ fail ] Test ended at 2026-04-22 16:44:39 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-22 16:44:39.227681694 +0300 @@ -518,10 +518,6 @@ charset('a') collation('a') coercibility('a') 'a'='A' latin1 latin1_swedish_ci 6 1 explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; -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 charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,'a' = 'A' AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value @@ -605,37 +601,13 @@ 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 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` 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 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` 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 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` 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 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` 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 ] 3269 main.ctype_collate_context [ pass ] 3295 main.ctype_collate_database [ pass ] 16 main.ctype_collate_implicit [ pass ] 26 main.ctype_collate_implicit_utf32 [ pass ] 8 main.ctype_collate_table [ pass ] 7 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_cp1250_ch [ pass ] 208 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_cp1251 [ pass ] 447 main.ctype_cp850 [ pass ] 43 main.ctype_cp866 [ pass ] 1 main.ctype_cp932 [ pass ] 90 main.ctype_create [ pass ] 21 main.ctype_dec8 [ pass ] 7 main.ctype_errors [ pass ] 13 main.ctype_eucjpms [ pass ] 1961 main.ctype_euckr [ pass ] 1122 main.ctype_filename [ pass ] 31 main.ctype_gb2312 [ pass ] 2603 main.ctype_gbk [ pass ] 2595 main.ctype_gbk_export_import [ skipped ] Need POSIX locale zh_CN.gbk main.ctype_hebrew [ pass ] 5 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_latin1 [ fail ] Test ended at 2026-04-22 16:45:52 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-22 16:45:52.369276021 +0300 @@ -3648,16 +3648,8 @@ # SET NAMES utf8; EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8mb3'abcd\xC3\xB3' AS `abcdó` SET NAMES latin1; EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8mb3'abcd\xC3\xB3' AS `abcd�` # # End of 5.5 tests # @@ -8120,10 +8112,6 @@ 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') DROP TABLE t1; # # MDEV-8698 Wrong result for SELECT..WHERE a BETWEEN 'a' AND 'c' COLLATE latin1_bin; @@ -8140,10 +8128,6 @@ 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) 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 ] 104 main.ctype_latin2 [ pass ] 31 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.ctype_latin2_ch [ pass ] 172 main.ctype_like_range [ pass ] 308 main.ctype_many [ pass ] 62 main.ctype_mb [ pass ] 10 main.ctype_nopad_8bit [ pass ] 902 main.ctype_recoding [ pass ] 32 main.ctype_sjis [ pass ] 2846 main.ctype_swe7 [ pass ] 1451 ReplayTest: Loading context ReplayTest: Loading context 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 ] 249 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:46:28 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-22 16:46:28.735134070 +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,7 @@ 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' 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' 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-22 16:46:33 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-22 16:46:33.171116812 +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 ] 226 main.ctype_ujis [ pass ] 1645 main.ctype_ujis_ucs2 [ pass ] 734 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context 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-22 16:46:48 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-22 16:46:48.019059128 +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-22 16:46:51 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-22 16:46:50.902047943 +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-22 16:46:54 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-22 16:46:54.121035459 +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-22 16:46:57 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-22 16:46:57.569022095 +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 ] 202 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-22 16:47:03 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-22 16:47:03.051000862 +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 ] 412 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 ] 143 main.ctype_utf8mb3_geeral1400_as_ci [ pass ] 6 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 ] 141 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 ] 168 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 ] 109 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 ] 115 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-22 16:47:21 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-22 16:47:20.806932199 +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-22 16:47:23 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-22 16:47:23.586921464 +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 ] 655 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 ] 163 main.ctype_utf8mb4_uca_allkeys1400 [ pass ] 11059 main.ctype_utf8mb4_uca_allkeys400 [ pass ] 3767 main.ctype_utf8mb4_uca_allkeys520 [ pass ] 5847 main.custom_aggregate_functions [ pass ] 145 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context main.custom_aggregates_i_s [ fail ] Test ended at 2026-04-22 16:48:13 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-22 16:48:12.931731603 +0300 @@ -37,43 +37,27 @@ 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 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 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 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 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 ReplayTest: optimizer_context returned no rows main.date_formats [ fail ] Test ended at 2026-04-22 16:48:15 CURRENT_TEST: main.date_formats --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/date_formats.result 2026-04-02 14:38:09.329657721 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/date_formats.reject 2026-04-22 16:48:15.118723217 +0300 @@ -368,10 +368,6 @@ Warnings: Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); -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 makedate(1997,1) AS `makedate(1997,1)`,addtime('31.12.97 11.59.59.999999 PM','1 1.1.1.000002') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime('31.12.97 11.59.59.999999 PM','1 1.1.1.000002') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff('01.01.97 11:59:59.000001 PM','31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date('15-01-2001 12:59:59','%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond('1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` create table t1 (d date); insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.date_formats/' main.datetime_456 [ pass ] 29 main.ddl_i18n_koi8r [ pass ] 1152 main.ddl_i18n_utf8 [ pass ] 1128 main.deadlock_ftwrl [ pass ] 16 main.default_debug [ pass ] 5 main.default_session [ pass ] 25 main.default_storage_engine [ pass ] 1397 main.delayed [ pass ] 2377 main.delete_returning_grant [ pass ] 26 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context v 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-22 16:49:18 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-22 16:49:18.108482653 +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 ] 68 main.deprecated_features [ pass ] 3 main.dirty_close [ pass ] 1036 main.drop_combinations [ pass ] 320 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.dyncol [ fail ] Test ended at 2026-04-22 18:25:33 CURRENT_TEST: main.dyncol --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/dyncol.result 2026-04-17 18:40:40.396796029 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/dyncol.reject 2026-04-22 18:25:33.274942086 +0300 @@ -147,10 +147,6 @@ 6, "2011-04-05" AS date, 7, "- 0:45:49.000001" AS time, 8, "2011-04-05 0:45:49.000001" AS datetime)) as ex; -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 hex(column_create(1,'afaf' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `ex` select hex(column_create(1, 0.0 AS decimal)); hex(column_create(1, 0.0 AS decimal)) 000100010004 @@ -165,16 +161,8 @@ 1212 explain extended select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int) as ex; -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 column_get(column_create(1,1212 AS unsigned int),1 as unsigned) AS `ex` explain extended select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned) as ex; -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 column_get(column_create(1,1212 AS unsigned int),1 as unsigned) AS `ex` select column_get(column_create(1, 1212 AS decimal), 1 as unsigned int) as ex; ex 1212 @@ -244,16 +232,8 @@ 1212 explain extended select column_get(column_create(1, 1212 AS int), 1 as int) as ex; -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 column_get(column_create(1,1212 AS int),1 as signed) AS `ex` explain extended select column_get(column_create(1, 1212 AS int), 1 as signed int) as ex; -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 column_get(column_create(1,1212 AS int),1 as signed) AS `ex` select column_get(column_create(1, -1212 AS int), 1 as int) as ex; ex -1212 @@ -351,10 +331,6 @@ 1212 explain extended select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8) as ex; -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 column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ),1 as char charset utf8mb3) AS `ex` select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) as ex; ex 1212 @@ -411,10 +387,6 @@ 1212 explain extended select column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary) as ex; -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 column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ),1 as char charset binary) AS `ex` # # column get real # @@ -423,16 +395,8 @@ 1212.12 explain extended select column_get(column_create(1, 1212.12 AS double), 1 as double) as ex; -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 column_get(column_create(1,1212.12 AS double),1 as double) AS `ex` explain extended select column_get(column_create(1, 1212.12 AS double), 1 as double(6,2)) as ex; -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 column_get(column_create(1,1212.12 AS double),1 as double(6,2)) AS `ex` select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double) as ex; ex 1.8446744073709552e19 @@ -504,16 +468,8 @@ 1212.12 explain extended select column_get(column_create(1, 1212.12 AS double), 1 as decimal) as ex; -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 column_get(column_create(1,1212.12 AS double),1 as decimal(10,0)) AS `ex` explain extended select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)) as ex; -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 column_get(column_create(1,1212.12 AS double),1 as decimal(6,2)) AS `ex` select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)) as ex; ex 18446744073709551615 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.dyncol/' main.empty_server_name-8224 [ pass ] 1432 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.empty_string_literal [ fail ] Test ended at 2026-04-22 18:25:41 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-22 18:25:40.914913157 +0300 @@ -160,25 +160,9 @@ DROP VIEW v1; DROP TABLE t1; 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` 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` 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` 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` # # 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 ] 125 main.empty_user_table [ pass ] 58 main.engine_error_in_alter-8453 [ 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 main.except [ pass ] 401 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 ] 390 main.execution_constants [ pass ] 397 ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1300 Invalid utf8mb4 character string: '\xD4\xC1\xC2' ReplayTest: Failed query was: DROP TABLE IF EXISTS test.��� ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Loading context ReplayTest: Query failed on replay server: 1364 Field 'f1' doesn't have a default value ReplayTest: Failed query was: REPLACE INTO test.t1() VALUES () ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Loading context main.explain [ fail ] Test ended at 2026-04-22 18:26:00 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-22 18:25:59.759550820 +0300 @@ -29,8 +29,6 @@ ERROR 42000: Key 'foo' doesn't exist in table 't1' drop table t1; explain select 1; -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 create table t1 (a int not null); explain select count(*) from t1; id select_type table type possible_keys key key_len ref rows Extra @@ -49,14 +47,10 @@ 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; explain select 3 into @v1; -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 create table t1(f1 int, f2 int); insert into t1 values (1,1); create view v1 as select * from t1 where f1=1; @@ -330,10 +324,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 +399,6 @@ 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 drop table t1, t2; # End of 10.1 tests # @@ -421,11 +408,6 @@ # MDEV-25564: Server crashed on running some EXPLAIN statements # EXPLAIN (SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2); -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 UNION NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNION RESULT ALL NULL NULL NULL NULL NULL Using filesort -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used # # MDEV-23160: SIGSEGV in Explain_node::print_explain_for_children on UNION SELECT # @@ -451,14 +433,6 @@ drop table t1; explain VALUES ( (VALUES (2))) UNION VALUES ( (SELECT 3)); -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 -5 SUBQUERY ALL NULL NULL NULL NULL 2 -2 DERIVED 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 -Warnings: -Note 1249 Select 4 was reduced during optimization # # End of 10.4 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.explain/' main.extra_server_example [ fail ] Test ended at 2026-04-22 18:26:05 CURRENT_TEST: main.extra_server_example Server process died during startup. Check /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/extra_server_1.err for errors. Failed to start extra server 1 (exit code: 512) mysqltest: In included file "./include/start_extra_server.inc": included from /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/extra_server_example.test at line 7: At line 51: command "perl" failed with error: 2 my_errno: 0 errno: 0 The result from queries just before the failure was: include/start_extra_server.inc [server 1] - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.extra_server_example/' main.failed_auth_3909 [ pass ] 3034 main.features 'nm' [ pass ] 61 main.filesort_bad_i_s-7585 [ pass ] 147 main.filesort_debug [ pass ] 29 main.filesort_pack [ pass ] 11 main.fix_priv_tables [ pass ] 857 main.flush [ pass ] 4286 main.flush_logs_not_windows [ pass ] 9 main.flush_notembedded [ pass ] 29 main.flush_ssl [ pass ] 2965 main.flush_table [ pass ] 4044 main.frm-debug [ pass ] 36 main.frm_bad_row_type-7333 [ pass ] 7 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.fulltext [ fail ] Test ended at 2026-04-22 18:27:05 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-22 18:27:05.693593627 +0300 @@ -14,10 +14,6 @@ Only MyISAM tables support collections Full-text indexes are called collections explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 fulltext a a 0 1 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against ('collections')) select * from t1 where MATCH(a,b) AGAINST ("indexes"); a b Full-text indexes are called collections @@ -51,43 +47,19 @@ select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WITH QUERY EXPANSION)' at line 1 explain select * from t1 where MATCH(a,b) AGAINST ("collections"); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>=0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain select * from t1 where MATCH(a,b) AGAINST ("collections")>=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where explain select * from t1 where 00 and a like '%ll%'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 fulltext a a 0 1 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against ('support -collections' in boolean mode)) select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); a b MySQL has now support for full-text search @@ -510,28 +482,16 @@ ('test', 5),('test', 6),('test', 7),('test', 8); EXPLAIN SELECT * FROM t1 WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext b,a a 0 1 Using where EXPLAIN SELECT * FROM t1 USE INDEX(a) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where EXPLAIN SELECT * FROM t1 FORCE INDEX(a) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext a a 0 1 Using where EXPLAIN SELECT * FROM t1 IGNORE INDEX(a) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref b b 5 const 5 Using where EXPLAIN SELECT * FROM t1 USE INDEX(b) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref b b 5 const 5 Using where EXPLAIN SELECT * FROM t1 FORCE INDEX(b) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref b b 5 const 5 Using where DROP TABLE t1; create table t1(a text,b date,fulltext index(a))engine=myisam; insert into t1 set a='water',b='2008-08-04'; @@ -604,10 +564,6 @@ SELECT 1 FROM t2, t3 WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE) ); -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 t2 fulltext b2 b2 0 1 Using where -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where # should return 0 SELECT count(*) FROM t1 WHERE not exists( @@ -760,11 +716,6 @@ 1 0 explain extended SELECT 'foo' IN ( SELECT f FROM t1 GROUP BY MATCH(f) AGAINST ( 'qux' IN BOOLEAN MODE )) as f1, MATCH(f) AGAINST ( 'qux' IN BOOLEAN MODE ) as f2 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 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` 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 ] 976 main.fulltext3 [ pass ] 17 main.fulltext_cache [ pass ] 15 main.fulltext_charsets [ pass ] 5 main.fulltext_derived_4257 [ pass ] 5 main.fulltext_derived_4316 [ pass ] 10 main.fulltext_distinct [ pass ] 9 main.fulltext_left_join [ pass ] 42 main.fulltext_multi [ pass ] 6 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.fulltext_order_by [ fail ] Test ended at 2026-04-22 18:27:28 CURRENT_TEST: main.fulltext_order_by --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/fulltext_order_by.result 2026-04-02 14:38:09.348657670 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/fulltext_order_by.reject 2026-04-22 18:27:28.715507281 +0300 @@ -64,8 +64,6 @@ match 1 alter table t1 add key m (message); explain SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 fulltext message message 0 1 Using where; Using filesort SELECT message FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY message desc; message steve is cool Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.fulltext_order_by/' main.fulltext_update [ pass ] 41 main.fulltext_var [ pass ] 11 main.func_bit [ pass ] 34 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_compress [ fail ] Test ended at 2026-04-22 18:27:38 CURRENT_TEST: main.func_compress --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_compress.result 2026-04-02 14:38:09.348657670 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_compress.reject 2026-04-22 18:27:38.153471933 +0300 @@ -12,18 +12,10 @@ uncompress(compress(@test_compress_string)) string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa explain extended select uncompress(compress(@test_compress_string)); -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 uncompress(compress(@`test_compress_string`)) AS `uncompress(compress(@test_compress_string))` select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) 1 explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); -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 uncompressed_length(compress(@`test_compress_string`)) = octet_length(@`test_compress_string`) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` select uncompressed_length(compress(@test_compress_string)); uncompressed_length(compress(@test_compress_string)) 117 @@ -103,18 +95,12 @@ create table t1 (a varchar(32) not null); insert into t1 values ('foo'); explain select * from t1 where uncompress(a) is null; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 -Warnings: -Warning 1259 ZLIB: Input data corrupted select * from t1 where uncompress(a) is null; a foo Warnings: Warning 1259 ZLIB: Input data corrupted explain select *, uncompress(a) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 select *, uncompress(a) from t1; a uncompress(a) foo NULL Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_compress/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_concat [ fail ] Test ended at 2026-04-22 18:27:41 CURRENT_TEST: main.func_concat --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_concat.result 2026-04-02 14:38:09.348657670 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_concat.reject 2026-04-22 18:27:41.439459632 +0300 @@ -115,9 +115,6 @@ gui_ABC str3 EXPLAIN SELECT CONCAT('gui_', t2.a), t1.d FROM t2 LEFT JOIN t1 ON t1.a = CONCAT('gui_', t2.a) AND t1.b = 'a' AND t1.c = 'b'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL PRIMARY 102 NULL 3 Using index -1 SIMPLE t1 eq_ref PRIMARY,a PRIMARY 318 func,const,const 1 Using where DROP TABLE t1, t2; # # Bug #50096: CONCAT_WS inside procedure returning wrong data Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_concat/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_crypt [ fail ] Test ended at 2026-04-22 18:27:44 CURRENT_TEST: main.func_crypt --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_crypt.result 2026-04-02 14:38:09.349657667 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_crypt.reject 2026-04-22 18:27:43.989450089 +0300 @@ -88,10 +88,6 @@ old_password(' i d k f a ') 5c078dc54ca0fcca explain extended select password('idkfa '), old_password('idkfa'); -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 password('idkfa ') AS `password('idkfa ')`,old_password('idkfa') AS `old_password('idkfa')` CREATE VIEW v1 AS SELECT ENCRYPT("dhgdhgd"); SELECT * FROM v1; drop view v1; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_crypt/' main.func_date_add [ pass ] 65 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_debug [ fail ] Test ended at 2026-04-22 18:27:49 CURRENT_TEST: main.func_debug --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_debug.result 2026-04-02 14:38:09.349657667 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_debug.reject 2026-04-22 18:27:48.980431418 +0300 @@ -1675,9 +1675,6 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); EXPLAIN SELECT * FROM t1 WHERE a IN (1,2,(SELECT MAX(a) FROM t1)); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where -2 SUBQUERY t1 ALL NULL NULL NULL NULL 10 SELECT * FROM t1 WHERE a IN (1,2,(SELECT MAX(a) FROM t1)); a 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_debug/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_default [ fail ] Test ended at 2026-04-22 18:27:52 CURRENT_TEST: main.func_default --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_default.result 2026-04-02 14:38:09.349657667 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_default.reject 2026-04-22 18:27:51.844420707 +0300 @@ -5,16 +5,10 @@ default(str) default(strnull) default(intg) default(rel) def NULL 10 3.14 explain extended select default(str), default(strnull), default(intg), default(rel) 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 default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from dual select * from t1 where str <> default(str); str strnull intg rel 0 0 explain select * from t1 where str <> default(str); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 create view v1 as select default(str), default(strnull), default(intg), default(rel) from t1; select * from v1; default(str) default(strnull) default(intg) default(rel) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_default/' main.func_des_encrypt [ pass ] 50 main.func_digest [ pass ] 100 main.func_encrypt_nossl [ skipped ] Test requires: embedded server main.func_encrypt_ucs2 [ pass ] 8 main.func_equal [ pass ] 17 main.func_extract [ pass ] 242 main.func_format [ pass ] 33 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_group [ fail ] Test ended at 2026-04-22 18:28:11 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-22 18:28:10.983349198 +0300 @@ -197,11 +197,7 @@ max(t2.a2) max(t1.a1) 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 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 insert into t2 values('AAA', 10, 0.5); insert into t2 values('BBB', 20, 1.0); select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2; @@ -289,10 +285,6 @@ 2 1 1 1.00000 0.00000 1 1 1 1 1 3 1 1 1.00000 0.00000 1 1 1 1 1 explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) 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 5 100.00 Using filesort -Warnings: -Note 1003 select sql_big_result `test`.`t1`.`a` AS `a`,count(`test`.`t1`.`b`) AS `count(b)`,sum(`test`.`t1`.`b`) AS `sum(b)`,avg(`test`.`t1`.`b`) AS `avg(b)`,std(`test`.`t1`.`b`) AS `std(b)`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)`,bit_and(`test`.`t1`.`b`) AS `bit_and(b)`,bit_or(`test`.`t1`.`b`) AS `bit_or(b)`,bit_xor(`test`.`t1`.`b`) AS `bit_xor(b)` from `test`.`t1` group by `test`.`t1`.`a` drop table t1; create table t1 (col int); insert into t1 values (-1), (-2), (-3); @@ -378,282 +370,190 @@ AAA AAA AA AME 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 select max(a3) from t1 where a3 = 'MIN' and a2 = 2; max(a3) MIN explain select max(a3) from t1 where a3 = 'DEN' 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 No matching min/max row select max(a3) from t1 where a3 = 'DEN' and a2 = 2; max(a3) NULL 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 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 explain select max(a3) from t1 where a2 is null 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 Impossible WHERE select max(a3) from t1 where a2 is null and a2 = 2; max(a3) NULL 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 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 select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; min(a3) CHI explain select min(a3) from t1 where a2 = 4; -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 select min(a3) from t1 where a2 = 4; min(a3) NULL 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 No matching min/max row select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; min(a3) NULL 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 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 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 select max(a3) from t1 where a2 = 2 and 'SEA' > a3; max(a3) MIN 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 No matching min/max row select max(a3) from t1 where a2 = 2 and 'SEA' < a3; max(a3) NULL 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 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 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 select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; min(a3) MIN explain select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' 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 Impossible WHERE select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; min(a3) NULL 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 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 explain select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain select min(a1) from t1 where (a1 < 'KKK' or a1 > 'KKK'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 3 NULL 14 Using where; Using index 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 t1 range k1 k1 3 NULL 7 Using where; Using index 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) explain select min(a4 - 0.01) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k2 12 NULL 15 Using index explain select max(a4 + 0.01) from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k2 12 NULL 15 Using index explain select min(a3) from t1 where (a2 +1 ) is null; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using index explain select min(a3) from t1 where (a2 + 1) = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using index explain select min(a3) from t1 where 2 = (a2 + 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using index explain select min(a2) from t1 where a2 < 2 * a2 - 8; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using index explain select min(a1) from t1 where a1 between a3 and 'KKK'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 15 Using where explain select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL k2 12 NULL 15 Using where; Using index 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) drop table t1, t2; create table t1 (a char(10)); insert into t1 values ('a'),('b'),('c'); @@ -835,8 +735,6 @@ MAX(b) xxxxbbbb EXPLAIN SELECT MAX(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 DROP TABLE t1; CREATE TABLE t1 (id int , b varchar(512), INDEX(b(250))) COLLATE latin1_bin; INSERT INTO t1 VALUES @@ -846,8 +744,6 @@ MAX(b) __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________zz EXPLAIN SELECT MAX(b) FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4 DROP TABLE t1; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,1),(1,2),(2,3); @@ -1326,8 +1222,6 @@ CREATE TABLE t1 ( a INT, b INT, KEY(a) ); 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 SELECT MIN(a), MIN(b) FROM t1; MIN(a) MIN(b) NULL 1 @@ -1335,24 +1229,18 @@ INSERT INTO t2 ( a, b, c ) VALUES ( 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 SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; MIN(b) MIN(c) 3 2 CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b)); 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 SELECT MIN(a), MIN(b) FROM t3 where a = 2; MIN(a) MIN(b) 2 NULL CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b)); 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 SELECT MIN(a), MIN(b) FROM t4 where a = 2; MIN(a) MIN(b) 2 NULL @@ -1362,8 +1250,6 @@ CREATE TABLE t5( a INT, b INT, KEY( a, b) ); 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 SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; MIN(a) MIN(b) 1 1 @@ -1406,10 +1292,6 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); CREATE VIEW v1 AS SELECT a,(a + 1) AS y FROM t1; EXPLAIN EXTENDED SELECT y FROM v1 GROUP BY v1.y; -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 temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`a` + 1 AS `y` from `test`.`t1` group by `test`.`t1`.`a` + 1 DROP VIEW v1; DROP TABLE t1; SET SQL_MODE=DEFAULT; @@ -1513,8 +1395,6 @@ SELECT MAX(pk) as max, i 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 # Only 11 is correct for column i in this result SELECT MAX(pk) as max, i @@ -1840,30 +1720,16 @@ (8,2), (6,9), (8,4), (5,3), (9,1); EXPLAIN EXTENDED SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<8; -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 tables used -Warnings: -Note 1003 /* select#1 */ select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where 0 SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10; MAX(a) NULL 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) -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 SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; MAX(a) NULL EXPLAIN EXTENDED SELECT MAX(a) FROM t1 WHERE RAND()*0<>0 AND a<10; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 4 NULL 3 100.00 Using where; Using index -Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where rand() * 0 <> 0 and `test`.`t1`.`a` < 10 SELECT MAX(a) FROM t1 WHERE RAND()*0<>0 AND a<10; MAX(a) NULL @@ -1879,13 +1745,6 @@ INSERT INTO t3 VALUES (19,1), (20,5); EXPLAIN EXTENDED SELECT (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) FROM t3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 -2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 -2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1276 Field or reference 'test.t3.b' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select <`test`.`t3`.`b`>((/* select#2 */ select min(1) from dual where 10 = `test`.`t3`.`b`)) AS `(SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b)` from `test`.`t3` SELECT (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) FROM t3; (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) NULL @@ -1898,43 +1757,31 @@ INSERT INTO t1 VALUES ('b', 'b'), ('a','a'); EXPLAIN SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; MAX(f1) NULL EXPLAIN SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref f2 f2 4 const 1 Using where; Using index SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; MAX(f2) NULL EXPLAIN SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; MIN(f1) b EXPLAIN SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range f2 f2 4 NULL 1 Using where; Using index SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; MIN(f2) b EXPLAIN SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; MIN(f1) b EXPLAIN SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range f2 f2 4 NULL 1 Using where; Using index SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; MIN(f2) b @@ -1984,13 +1831,6 @@ HAVING ('m') IN ( 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 -Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'j' -Warning 1292 Truncated incorrect DOUBLE value: 'j' -Warning 1292 Truncated incorrect DOUBLE value: 'j' # # 2) Test that subquery materialization is setup for query with @@ -2012,9 +1852,6 @@ HAVING ('m') IN ( 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 # # 3) Test that subquery materialization is setup for query with @@ -2036,9 +1873,6 @@ HAVING ('m') IN ( 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 # # 4) Test that subquery materialization is setup for query with @@ -2061,10 +1895,6 @@ HAVING ('m') IN ( 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 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table set optimizer_switch=@tmp_optimizer_switch; # @@ -2088,10 +1918,6 @@ HAVING ('m') IN ( 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 -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables set @@optimizer_switch=@save_optimizer_switch; # # Cleanup for BUG#46680 @@ -2214,15 +2040,11 @@ INSERT INTO `t1` (b) VALUES ('2013-07-06 23:59:59'); # 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 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 connection default; disconnect con1; DROP TABLE t1; @@ -2239,8 +2061,6 @@ insert into t1 (b) values (INET_ATON('192.168.200.200')); # 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 DROP TABLE t1; # # MDEV-6743 crash in GROUP_CONCAT(IF () ORDER BY 1) @@ -2387,14 +2207,6 @@ create table t11 as select * from t10; create table t12 as select * from t10; explain extended select a from t10 where c<3 or a in (select c from t12 union select max(t10.b) from t11 group by t11.c); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t10 ALL NULL NULL NULL NULL 2 100.00 Using where -2 DEPENDENT SUBQUERY t12 ALL NULL NULL NULL NULL 2 100.00 Using where -3 DEPENDENT UNION t11 ALL NULL NULL NULL NULL 2 100.00 Using temporary -NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1276 Field or reference 'test.t10.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t10`.`a` AS `a` from `test`.`t10` where `test`.`t10`.`c` < 3 or <`test`.`t10`.`a`,`test`.`t10`.`b`>((`test`.`t10`.`a`,(/* select#2 */ select `test`.`t12`.`c` from `test`.`t12` where (`test`.`t10`.`a`) = `test`.`t12`.`c` union /* select#3 */ select max(`test`.`t10`.`b`) from `test`.`t11` group by `test`.`t11`.`c` having (`test`.`t10`.`a`) = (max(`test`.`t10`.`b`))))) drop table t10,t11,t12; # # MDEV-10017: Get unexpected `Empty Set` for correlated subquery @@ -2419,13 +2231,6 @@ ERROR HY000: Invalid use of group function explain extended select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt)); -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 -2 DEPENDENT SUBQUERY t system NULL NULL NULL NULL 1 100.00 -3 DEPENDENT SUBQUERY tt system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1276 Field or reference 'test.t1.c1' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1` from `test`.`t1` having `test`.`t1`.`c1` >= <`test`.`t1`.`c1`>((/* select#2 */ select 2 AS `c` from dual order by (/* select#3 */ select min(`test`.`t1`.`c1` + 2) from dual))) select c1 from t1 having c1 >= (select t.c1 as c from t2 t order by (select min(t1.c1+tt.c1) from t2 tt)); c1 2 @@ -2461,27 +2266,19 @@ max(a) 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 t1 ALL NULL NULL NULL NULL 5 Using where 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 t1 ALL NULL NULL NULL NULL 5 Using where create index idx on t1(a); select max(a) from t1 where a < 303 and (a between 267 AND 287); max(a) 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 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 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 ] 419 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_if [ fail ] Test ended at 2026-04-22 18:28:18 CURRENT_TEST: main.func_if --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_if.result 2026-04-02 14:38:09.353657656 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_if.reject 2026-04-22 18:28:18.061322779 +0300 @@ -40,10 +40,6 @@ aa aaa explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order by s; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 Using where; Using filesort -Warnings: -Note 1003 select if(`test`.`t1`.`u` = 1,`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where `test`.`t1`.`st` like '%a%' order by if(`test`.`t1`.`u` = 1,`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) select nullif(u, 1) from t1; nullif(u, 1) NULL @@ -54,10 +50,6 @@ 0 0 explain extended select nullif(u, 1) from t1; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 7 100.00 -Warnings: -Note 1003 select nullif(`test`.`t1`.`u`,1) AS `nullif(u, 1)` from `test`.`t1` drop table t1; select nullif(1,'test'); nullif(1,'test') Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_if/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_in [ fail ] Test ended at 2026-04-22 18:28: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-22 18:28:22.629305737 +0300 @@ -142,10 +142,6 @@ a b c a c c explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin); -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`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 'a' in (`test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` collate latin1_bin) drop table t1; set names utf8; create table t1 (a char(10) character set utf8 not null); @@ -239,8 +235,6 @@ insert into t2 select C.a*2+1, 'yes' from t1 C; explain select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 11 Using index condition select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18); a filler 1 yes @@ -254,11 +248,7 @@ 17 yes 19 yes explain select * from t2 force index(a) where a NOT IN (2,2,2,2,2,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 912 Using index condition explain select * from t2 force index(a) where a <> 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 912 Using index condition drop table t2; create table t2 (a datetime, filler char(200), key(a)); insert into t2 select '2006-04-25 10:00:00' + interval C.a minute, @@ -269,8 +259,6 @@ select * from t2 where a NOT IN ( '2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00', '2006-04-25 10:06:00', '2006-04-25 10:08:00'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 6 NULL 11 Using index condition select * from t2 where a NOT IN ( '2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00', '2006-04-25 10:06:00', '2006-04-25 10:08:00'); @@ -293,8 +281,6 @@ insert into t2 values ('fon', '1'), ('fop','1'), ('barbaq','1'), ('barbas','1'), ('bazbazbay', '1'),('zz','1'); explain select * from t2 where a not in('foo','barbar', 'bazbazbaz'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 13 NULL 6 Using index condition drop table t2; create table t2 (a decimal(10,5), filler char(200), key(a)); insert into t2 select 345.67890, 'no' from t1 A, t1 B; @@ -304,8 +290,6 @@ (55555,'1'), (77777, '1'); explain select * from t2 where a not in (345.67890, 43245.34, 64224.56344); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 7 NULL 6 Using index condition select * from t2 where a not in (345.67890, 43245.34, 64224.56344); a filler 0.00000 1 @@ -367,11 +351,6 @@ JOIN t1 ON t3.a=t1.a JOIN t2 ON t3.a=t2.a JOIN t4 WHERE t4.a IN (t1.b, t2.b); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 4 Using index -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 -1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 7 Range checked for each record (index map: 0x1) SELECT STRAIGHT_JOIN * FROM t3 JOIN t1 ON t3.a=t1.a JOIN t2 ON t3.a=t2.a @@ -385,11 +364,6 @@ (SELECT SUM(t4.a) FROM t4 WHERE t4.a IN (t1.b, t2.b)) FROM t3, t1, t2 WHERE t3.a=t1.a AND t3.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 4 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 -2 DEPENDENT SUBQUERY t4 index NULL PRIMARY 4 NULL 7 Using where; Using index SELECT STRAIGHT_JOIN (SELECT SUM(t4.a) FROM t4 WHERE t4.a IN (t1.b, t2.b)) FROM t3, t1, t2 @@ -513,15 +487,11 @@ Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'b' explain select f1 from t1 where f1 in ('a',1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index t1f1_idx t1f1_idx 2 NULL 3 Using where; Using index select f1 from t1 where f1 in ('a','b'); f1 a b explain select f1 from t1 where f1 in ('a','b'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range t1f1_idx t1f1_idx 2 NULL 2 Using where; Using index select f1 from t1 where f1 in (2,1); f1 1 @@ -529,10 +499,6 @@ Warning 1292 Truncated incorrect DECIMAL value: 'a' Warning 1292 Truncated incorrect DECIMAL value: 'b' explain select f1 from t1 where f1 in (2,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index t1f1_idx t1f1_idx 2 NULL 3 Using where; Using index -Warnings: -Note 1105 Cannot use key `t1f1_idx` part[0] for lookup: `test`.`t1`.`f1` of type `char` = "2" of type `int` create table t2(f2 int, index t2f2(f2)); insert into t2 values(0),(1),(2); select f2 from t2 where f2 in ('a',2); @@ -544,8 +510,6 @@ Warning 1292 Truncated incorrect DECIMAL value: 'a' Warning 1292 Truncated incorrect DECIMAL value: 'a' explain select f2 from t2 where f2 in ('a',2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2f2 t2f2 5 NULL 3 Using where; Using index select f2 from t2 where f2 in ('a','b'); f2 0 @@ -553,11 +517,6 @@ Warning 1292 Truncated incorrect DECIMAL value: 'a' Warning 1292 Truncated incorrect DECIMAL value: 'b' explain select f2 from t2 where f2 in ('a','b'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref t2f2 t2f2 5 const 1 Using index -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: 'a' -Warning 1292 Truncated incorrect DECIMAL value: 'b' select f2 from t2 where f2 in (1,'b'); f2 0 @@ -566,8 +525,6 @@ Warning 1292 Truncated incorrect DECIMAL value: 'b' Warning 1292 Truncated incorrect DECIMAL value: 'b' explain select f2 from t2 where f2 in (1,'b'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2f2 t2f2 5 NULL 3 Using where; Using index drop table t1, t2; create table t1 (a time, key(a)); insert into t1 values (),(),(),(),(),(),(),(),(),(); @@ -634,125 +591,49 @@ INSERT IGNORE INTO t1 (c_int) SELECT 0 FROM t1; INSERT IGNORE INTO t1 (c_int) SELECT 0 FROM t1; EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_int c_int 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL, 1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_int c_int 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_int c_int 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, NULL, 2, NULL, 3, NULL); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_int c_int 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_decimal c_decimal 3 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL, 1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_decimal c_decimal 3 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_float IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_float c_float 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL, 1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_float c_float 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_bit IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_bit c_bit 2 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL, 1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_bit c_bit 2 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_date IN ('2009-09-01', '2009-09-02', '2009-09-03'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_date c_date 3 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_date IN (NULL, '2009-09-01', '2009-09-02', '2009-09-03'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_date c_date 3 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_date IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_date IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_datetime IN ('2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL, '2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN ('2009-09-01 00:00:01', '2009-09-01 00:00:02', '2009-09-01 00:00:03'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_timestamp c_timestamp 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN (NULL, '2009-09-01 00:00:01', '2009-09-01 00:00:02', '2009-09-01 00:00:03'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_timestamp c_timestamp 4 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_year IN (1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_year c_year 1 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL, 1, 2, 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_year c_year 1 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL, NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_char c_char 10 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c_char c_char 10 NULL 3 Using index condition EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL); -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 EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL); -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 DROP TABLE t1; # # Bug#54477: Crash on IN / CASE with NULL arguments @@ -840,22 +721,10 @@ INSERT INTO t1 VALUES (1),(2); # Ok to propagate equalities into the left IN argument in case of a single comparison type EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a 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 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Ok to propagate equalities into IN () list, even if multiple comparison types EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND 1 IN (1,a,'3'); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 # Not Ok to propagate equalities into the left IN argument in case of multiple comparison types EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND a 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 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` in (1,2,'3') DROP TABLE t1; # # Start of 10.3 tests @@ -958,11 +827,7 @@ (24,9223403470951992681),(25,9223405581879567267),(26,9223405754978563829), (27,9223405972966828221), (28, 9223372036854775808), (29, 9223372036854775807) ; explain SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775807 ); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a range c1 c1 9 NULL 2 Using where; Using index explain SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775808 ); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a range c1 c1 9 NULL 2 Using where; Using index SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775807 ); c1 9223372036854775807 @@ -985,14 +850,8 @@ MIN(id) MAX(id) COUNT(*) 1 256 256 EXPLAIN SELECT id FROM t1 WHERE id IN (1,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index DROP TABLE t1; # # MDEV-18898 SELECT using wrong index when using operator IN with mixed types @@ -1062,42 +921,28 @@ 1 # 'const' access since 'a IN (1,1)' is converted to equality 'a=1' EXPLAIN SELECT * FROM t1 WHERE a IN (1,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index EXPLAIN SELECT * FROM t1 WHERE a = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index SELECT * FROM t1 WHERE a IN (1,1,2); a 1 2 # Conversion to equality is impossible due to different values EXPLAIN SELECT * FROM t1 WHERE a IN (1,1,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index SELECT * FROM t1 WHERE a IN (1,NULL,1); a 1 # Conversion to equality is impossible due to NULL in the IN list EXPLAIN SELECT * FROM t1 WHERE a IN (1,NULL,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using index SELECT * FROM t1 WHERE a NOT IN (2,2,2,2,2,2); a 1 3 EXPLAIN SELECT * FROM t1 WHERE a NOT IN (2,2,2,2,2,2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index EXPLAIN SELECT * FROM t1 WHERE a != 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index SELECT * FROM t1 WHERE a NOT IN (3,3,1,1); a 2 EXPLAIN SELECT * FROM t1 WHERE a NOT IN (3,3,1,1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index SELECT * FROM t1 WHERE a NOT IN (1,2,NULL,NULL); a # No conversion is possible since elements are not constant @@ -1106,10 +951,6 @@ 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 # There must be no conversion here: SELECT * FROM t1 WHERE a IN (3,2,3,3,1,2,3); a @@ -1130,8 +971,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 +978,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 +996,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 +1035,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/' main.func_int [ pass ] 26 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_isnull [ fail ] Test ended at 2026-04-22 18:28:29 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-22 18:28:28.886282402 +0300 @@ -41,10 +41,6 @@ 0000-00-00 00:00:00 0000-00-00 00:00:00 EXPLAIN EXTENDED SELECT * FROM t1 WHERE d1 IS NULL; -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`.`d1` AS `d1` from `test`.`t1` where `test`.`t1`.`d1` = 0 SELECT count(*) FROM t1 WHERE d1 IS NULL; count(*) 2 @@ -59,10 +55,6 @@ 0000-00-00 00:00:00 0000-00-00 00:00:00 EXPLAIN EXTENDED SELECT * FROM v1 WHERE d1 IS NULL; -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`.`d1` AS `d1` from `test`.`t1` where `test`.`t1`.`d1` = 0 SELECT count(*) FROM v1 WHERE d1 IS NULL; count(*) 2 @@ -86,11 +78,6 @@ 1980-09-03 20:49:36 NULL EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON t2.d1=t1.d1 WHERE t1.d1 IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`d1` = `test`.`t2`.`d1`) where `test`.`t1`.`d1` = 0 or `test`.`t1`.`d1` is null SELECT * FROM t2 LEFT JOIN v1 ON t2.d1=v1.d1 WHERE v1.d1 IS NULL; d1 d1 0000-00-00 00:00:00 0000-00-00 00:00:00 @@ -98,11 +85,6 @@ 1980-09-03 20:49:36 NULL EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN v1 ON t2.d1=v1.d1 WHERE v1.d1 IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`t2` left join (`test`.`t1`) on(`test`.`t1`.`d1` = `test`.`t2`.`d1`) where `test`.`t1`.`d1` = 0 or `test`.`t1`.`d1` is null DROP VIEW v1; DROP TABLE t1,t2; # @@ -114,15 +96,7 @@ 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 -Warnings: -Note 1003 select ifnull(1,0) AS `IFNULL(pk,0)` from dual DROP VIEW v1; DROP TABLE t1; # 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 ] 76 main.func_kdf 'new' [ pass ] 58 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_like [ fail ] Test ended at 2026-04-22 18:28:36 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-22 18:28:35.803256619 +0300 @@ -2,15 +2,7 @@ create table t1 (a varchar(10), key(a)) charset=latin1; 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 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like 'abc%' 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 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` like (concat('abc','%')) select * from t1 where a like "abc%"; a abc @@ -221,10 +213,6 @@ a 10.00 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10.0 AND a LIKE 10.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` = 10.0 and `test`.`t1`.`a` like 10.00 DROP TABLE t1; # # MDEV-8599 "WHERE varchar_field LIKE temporal_const" does not use range optimizer @@ -239,11 +227,7 @@ INSERT INTO t1 VALUES ('00:00:06'); INSERT INTO t1 VALUES ('00:00:07'); EXPLAIN SELECT * FROM t1 WHERE a LIKE '00:00:00'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 13 NULL 1 Using where; Using index EXPLAIN SELECT * FROM t1 WHERE a LIKE TIME'00:00:00'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 13 NULL 1 Using where; Using index SELECT * FROM t1 WHERE a LIKE '00:00:00'; a 00:00:00 @@ -418,10 +402,6 @@ 1 1 0 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 EXPLAIN EXTENDED SELECT * FROM v1; -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 filesort -Warnings: -Note 1003 select 1 like `test`.`t1`.`c1` | `test`.`t1`.`c2` AS `1 LIKE c1|c2`,1 like `test`.`t1`.`c1` & `test`.`t1`.`c2` AS `1 LIKE c1&c2`,1 like `test`.`t1`.`c2` >> `test`.`t1`.`c1` AS `1 LIKE c2>>c1`,2 like `test`.`t1`.`c2` << `test`.`t1`.`c1` AS `2 LIKE c2< 0 AS `1 LIKE c1||c2`,2 like `test`.`t1`.`c1` + `test`.`t1`.`c2` AS `2 LIKE c1+c2`,-1 like `test`.`t1`.`c1` - `test`.`t1`.`c2` AS `-1 LIKE c1-c2`,2 like `test`.`t1`.`c1` * `test`.`t1`.`c2` AS `2 LIKE c1*c2`,0.5000 like `test`.`t1`.`c1` / `test`.`t1`.`c2` AS `0.5000 LIKE c1/c2`,0 like `test`.`t1`.`c1` DIV `test`.`t1`.`c2` AS `0 LIKE c1 DIV c2`,0 like `test`.`t1`.`c1` MOD `test`.`t1`.`c2` AS `0 LIKE c1 MOD c2` from `test`.`t1` order by `test`.`t1`.`c2` DROP VIEW v1; DROP TABLE t1; # 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: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_math [ fail ] Test ended at 2026-04-22 18:28:39 CURRENT_TEST: main.func_math --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_math.result 2026-04-02 14:38:09.355657651 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_math.reject 2026-04-22 18:28:39.387243265 +0300 @@ -2,34 +2,18 @@ floor(5.5) floor(-5.5) 5 -6 explain extended select floor(5.5),floor(-5.5); -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 floor(5.5) AS `floor(5.5)`,floor(-5.5) AS `floor(-5.5)` select ceiling(5.5),ceiling(-5.5); ceiling(5.5) ceiling(-5.5) 6 -5 explain extended select ceiling(5.5),ceiling(-5.5); -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 ceiling(5.5) AS `ceiling(5.5)`,ceiling(-5.5) AS `ceiling(-5.5)` select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1); truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1) 52.6 52.64 50 0 -52.6 -50 explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-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 No tables used -Warnings: -Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-1) AS `truncate(52.64,-1)`,truncate(52.64,-2) AS `truncate(52.64,-2)`,truncate(-52.64,1) AS `truncate(-52.64,1)`,truncate(-52.64,-1) AS `truncate(-52.64,-1)` select round(5.5),round(-5.5); round(5.5) round(-5.5) 6 -6 explain extended select round(5.5),round(-5.5); -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 round(5.5,0) AS `round(5.5)`,round(-5.5,0) AS `round(-5.5)` select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2); round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2) 5.6 5.64 10 0 @@ -37,10 +21,6 @@ abs(-10) sign(-5) sign(5) sign(0) 10 -1 1 0 explain extended select abs(-10), sign(-5), sign(5), sign(0); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select abs(-10) AS `abs(-10)`,sign(-5) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)` select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2) 10 10.000000000000002 NULL NULL NULL 2 NULL NULL @@ -49,10 +29,6 @@ Warning 1365 Division by 0 Warning 1365 Division by 0 explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2); -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 log(exp(10)) AS `log(exp(10))`,exp(log(sqrt(10)) * 2) AS `exp(log(sqrt(10))*2)`,log(-1) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-1,2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)` select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL) 10 10.000000000000002 NULL NULL NULL @@ -60,10 +36,6 @@ Warning 1365 Division by 0 Warning 1365 Division by 0 explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL); -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 ln(exp(10)) AS `ln(exp(10))`,exp(ln(sqrt(10)) * 2) AS `exp(ln(sqrt(10))*2)`,ln(-1) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` select log2(8),log2(15),log2(-2),log2(0),log2(NULL); log2(8) log2(15) log2(-2) log2(0) log2(NULL) 3 3.9068905956085187 NULL NULL NULL @@ -71,10 +43,6 @@ Warning 1365 Division by 0 Warning 1365 Division by 0 explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); -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 log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-2) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` select log10(100),log10(18),log10(-4),log10(0),log10(NULL); log10(100) log10(18) log10(-4) log10(0) log10(NULL) 2 1.255272505103306 NULL NULL NULL @@ -82,35 +50,19 @@ Warning 1365 Division by 0 Warning 1365 Division by 0 explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); -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 log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-4) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)` select pow(10,log10(10)),power(2,4); pow(10,log10(10)) power(2,4) 10 16 explain extended select pow(10,log10(10)),power(2,4); -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 pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)` set @@rand_seed1=10000000,@@rand_seed2=1000000; select rand(999999),rand(); rand(999999) rand() 0.014231365187309091 0.028870999839968048 explain extended select rand(999999),rand(); -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 rand(999999) AS `rand(999999)`,rand() AS `rand()` select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6); pi() format(sin(pi()/2),6) format(cos(pi()/2),6) format(abs(tan(pi())),6) format(cot(1),6) format(asin(1),6) format(acos(0),6) format(atan(1),6) 3.141593 1.000000 0.000000 0.000000 0.642093 1.570796 1.570796 0.785398 explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6); -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 pi() AS `pi()`,format(sin(pi() / 2),6) AS `format(sin(pi()/2),6)`,format(cos(pi() / 2),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format(cot(1),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` select degrees(pi()),radians(360); degrees(pi()) radians(360) 180 6.283185307179586 @@ -148,10 +100,6 @@ format(4.55, 1) format(4.551, 1) 4.6 4.6 explain extended select degrees(pi()),radians(360); -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 degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` select rand(rand); ERROR 42S22: Unknown column 'rand' in 'SELECT' create table t1 (col1 int, col2 decimal(60,30)); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_math/' main.func_numconv [ pass ] 159 main.func_numconv_debug [ pass ] 10 main.func_numconv_format [ pass ] 18027 main.func_numconv_ucs2 [ pass ] 10 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_op [ fail ] Test ended at 2026-04-22 18:29:22 CURRENT_TEST: main.func_op --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_op.result 2026-04-02 14:38:09.356657648 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_op.reject 2026-04-22 18:29:21.906896773 +0300 @@ -2,18 +2,10 @@ 1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 2 0 3 1.6000 3 3 3 4 explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; -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 + 1 AS `1+1`,1 - 1 AS `1-1`,1 + 1 * 2 AS `1+1*2`,8 / 5 AS `8/5`,8 MOD 5 AS `8%5`,8 MOD 5 AS `mod(8,5)`,8 MOD 5 | 0 AS `mod(8,5)|0`,-(1 + 1) * -2 AS `-(1+1)*-2` select 1 | (1+1),5 & 3,bit_count(7) ; 1 | (1+1) 5 & 3 bit_count(7) 3 1 3 explain extended select 1 | (1+1),5 & 3,bit_count(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 1 | 1 + 1 AS `1 | (1+1)`,5 & 3 AS `5 & 3`,bit_count(7) AS `bit_count(7)` select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60; 1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60 4294967296 9223372036854775808 0 1 0 8 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_op/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_regexp [ fail ] Test ended at 2026-04-22 18:29:24 CURRENT_TEST: main.func_regexp --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_regexp.result 2026-04-02 14:38:09.356657648 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_regexp.reject 2026-04-22 18:29:24.221678350 +0300 @@ -52,10 +52,6 @@ xxx this is a test of some long text to see what happens explain extended select * from t1 where xxx regexp('is a test of some long text to'); -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 'this is a test of some long text to see what happens' AS `xxx` from dual where 1 select * from t1 where xxx regexp('is a test of some long text to '); xxx this is a test of some long text to see what happens Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_regexp/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_regexp_pcre [ fail ] Test ended at 2026-04-22 18:29:27 CURRENT_TEST: main.func_regexp_pcre --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_regexp_pcre.result 2026-04-17 18:40:40.406796647 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_regexp_pcre.reject 2026-04-22 18:29:26.984066245 +0300 @@ -414,10 +414,6 @@ ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci DROP TABLE t1; EXPLAIN EXTENDED SELECT REGEXP_REPLACE('abc','b','x'); -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 regexp_replace('abc','b','x') AS `REGEXP_REPLACE('abc','b','x')` SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT REGEXP_REPLACE('abc','b','x')+0; Warnings: @@ -717,10 +713,6 @@ ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci DROP TABLE t1; EXPLAIN EXTENDED SELECT REGEXP_SUBSTR('abc','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 regexp_substr('abc','b') AS `REGEXP_SUBSTR('abc','b')` SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b')+0; Warnings: Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_regexp_pcre/' main.func_regexp_pcre_debug [ pass ] 9 main.func_replace [ pass ] 28 main.func_sapdb [ pass ] 23 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_set [ fail ] Test ended at 2026-04-22 18:29:36 CURRENT_TEST: main.func_set --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_set.result 2026-04-02 14:38:09.357657646 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_set.reject 2026-04-22 18:29:35.847033348 +0300 @@ -2,10 +2,6 @@ interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0 5 2 4 0 TWO 0 1 1.1 explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select interval(55,10,20,30,40,50,60,70,80,90,100) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval(3,1,1 + 1,1 + 1 + 1 + 1) AS `interval(3,1,1+1,1+1+1+1)`,field('IBM','NCA','ICL','SUN','IBM','DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field('A','B','C') AS `field("A","B","C")`,elt(2,'ONE','TWO','THREE') AS `elt(2,"ONE","TWO","THREE")`,interval(0,1,2,3,4) AS `interval(0,1,2,3,4)`,elt(1,1,2,3) | 0 AS `elt(1,1,2,3)|0`,elt(1,1.1,1.2,1.3) + 0 AS `elt(1,1.1,1.2,1.3)+0` SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_set/' main.func_sformat [ pass ] 80 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_system [ fail ] Test ended at 2026-04-22 18:29:41 CURRENT_TEST: main.func_system --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_system.result 2026-04-02 14:38:09.358657643 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_system.reject 2026-04-22 18:29:40.797014982 +0300 @@ -38,10 +38,6 @@ charset(version()) utf8mb3 explain extended select database(), user(); -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 database() AS `database()`,user() AS `user()` create table t1 (version char(60)) select database(), user(), version() as 'version'; show create table t1; Table Create Table Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_system/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_test [ fail ] Test ended at 2026-04-22 18:29:43 CURRENT_TEST: main.func_test --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_test.result 2026-04-02 14:38:09.358657643 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_test.reject 2026-04-22 18:29:43.190006106 +0300 @@ -45,10 +45,6 @@ 3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1 8 0 1 NULL NULL explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 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 No tables used -Warnings: -Note 1003 select 3 ^ 11 AS `3 ^ 11`,1 ^ 1 AS `1 ^ 1`,1 ^ 0 AS `1 ^ 0`,1 ^ NULL AS `1 ^ NULL`,NULL ^ 1 AS `NULL ^ 1` select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; 1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL 0 1 1 0 NULL NULL NULL @@ -59,35 +55,19 @@ 10 % 7 10 mod 7 10 div 3 3 3 3 explain extended select 10 % 7, 10 mod 7, 10 div 3; -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 10 MOD 7 AS `10 % 7`,10 MOD 7 AS `10 mod 7`,10 DIV 3 AS `10 div 3` select 18446744073709551615, 18446744073709551615 DIV 1, 18446744073709551615 DIV 2; 18446744073709551615 18446744073709551615 DIV 1 18446744073709551615 DIV 2 18446744073709551615 18446744073709551615 9223372036854775807 explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; -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 << 64) - 1 AS `(1 << 64)-1`,((1 << 64) - 1) DIV 1 AS `((1 << 64)-1) DIV 1`,((1 << 64) - 1) DIV 2 AS `((1 << 64)-1) DIV 2` create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; a explain extended select * from t1 where 1 xor 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 Impossible WHERE -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0 select - a from t1; - a -1 explain extended select - a 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 -1 AS `- a` from dual drop table t1; select _koi8r'a' = _koi8r'A'; _koi8r'a' = _koi8r'A' @@ -96,10 +76,6 @@ _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci 1 explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; -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 _koi8r'a' = _koi8r'A' collate koi8r_general_ci AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; _koi8r'a' = _koi8r'A' COLLATE koi8r_bin 0 @@ -285,18 +261,10 @@ 1 NULL explain extended select not 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 4 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` = 0 AS `not a` from `test`.`t1` select * from t1 where not a; a 0 explain extended select * from t1 where not a; -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` is false select not (a+0) from t1; not (a+0) 0 @@ -304,18 +272,10 @@ 1 NULL explain extended select not (a+0) from t1; -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 -Warnings: -Note 1003 select !(`test`.`t1`.`a` + 0) AS `not (a+0)` from `test`.`t1` select * from t1 where not (a+0); a 0 explain extended select * from t1 where not (a+0); -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` + 0) select not 1, not null, not not null, 1 is not null; not 1 not null not not null 1 is not null 0 NULL NULL 1 @@ -330,10 +290,6 @@ NOT NOT strcmp('a','b') 1 EXPLAIN EXTENDED SELECT NOT NOT strcmp('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 strcmp('a','b') <> 0 AS `NOT NOT strcmp('a','b')` # # End of 10.0 tests # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_test/' ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_time [ fail ] Test ended at 2026-04-22 18:29:54 CURRENT_TEST: main.func_time --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_time.result 2026-04-17 18:40:40.410796894 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_time.reject 2026-04-22 18:29:54.295964927 +0300 @@ -855,10 +855,6 @@ strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0 1 explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"), month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03 23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02 10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1 SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02 10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND); -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 period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,weekday(curdate()) - weekday(current_timestamp()) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time(time_to_sec('0:30:47') / 6.21) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,'1997-12-31 23:59:59' + interval 1 second AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,'1998-01-01 00:00:00' - interval 1 second AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,'1997-12-31' + interval 1 day AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,'1997-12-31 23:59:59' + interval 1 second AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)` SET @TMP='2007-08-01 12:22:49'; CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ('2007-08-01 12:22:59'); @@ -3527,15 +3523,7 @@ default(pk) 1 explain extended select * from v3; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual explain extended select default(pk) from t2; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 -Warnings: -Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual show create view v3; View Create View character_set_client collation_connection v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select default(`t2`.`pk`) AS `default(pk)` from `t2` latin1 latin1_swedish_ci @@ -3798,18 +3786,10 @@ EXPLAIN EXTENDED SELECT TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1, -INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2; -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 TIMESTAMP'2001-01-01 10:20:30' - interval '10' year AS `c1`,TIMESTAMP'2001-01-01 10:20:30' - interval '10' year AS `c2` EXPLAIN EXTENDED SELECT TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1, INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2, +INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3; -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 TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS `c1`,TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS `c2`,TIMESTAMP'2001-01-01 10:20:30' + interval '10' year AS `c3` CREATE TABLE t_ts (a timestamp(6)); CREATE TABLE t_trig (a timestamp(6)); CREATE FUNCTION fn_sleep_before_now() returns int @@ -3853,10 +3833,6 @@ SELECT * FROM t1 WHERE SUBTIME(a,TIME'00:00:01')=TIME'00:00:09' AND ADDTIME(a,TIME'00:00:01')<=TIME'00:00:09'; a EXPLAIN EXTENDED SELECT * FROM t1 WHERE SUBTIME(a,TIME'00:00:01')=TIME'00:00:09' AND ADDTIME(a,TIME'00:00:01')<=TIME'00:00:09'; -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 subtime(`test`.`t1`.`a`,TIME'00:00:01') = TIME'00:00:09' and addtime(`test`.`t1`.`a`,TIME'00:00:01') <= TIME'00:00:09' DROP TABLE t1; # # MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME) @@ -6467,10 +6443,6 @@ LOCALTIME 14:47:00 EXPLAIN EXTENDED SELECT LOCALTIME; -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 curtime() AS `LOCALTIME` CREATE TABLE t1 AS SELECT LOCALTIME; SHOW CREATE TABLE t1; Table Create Table Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_time/' main.func_time_32 [ skipped ] Need a 32 bit timestamps main.func_time_64 [ pass ] 31 ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.func_time_hires [ fail ] Test ended at 2026-04-22 18:30:07 CURRENT_TEST: main.func_time_hires --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_time_hires.result 2026-04-02 14:38:09.360657637 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_time_hires.reject 2026-04-22 18:30:07.489170288 +0300 @@ -153,10 +153,6 @@ t6 12:13:14.123456 drop table t1; explain extended select cast(cast(@a as datetime(4)) as time(0)); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select cast(cast(@`a` as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))` select cast(cast(@a as time(2)) as time(6)); cast(cast(@a as time(2)) as time(6)) 12:13:14.120000 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_time_hires/' main.func_time_round [ pass ] 142 main.func_timestamp [ pass ] 6 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.func_weight_string [ fail ] Test ended at 2026-04-22 18:30:14 CURRENT_TEST: main.func_weight_string --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_weight_string.result 2026-04-02 14:38:09.360657637 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/func_weight_string.reject 2026-04-22 18:30:14.546889918 +0300 @@ -117,30 +117,18 @@ 000001 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null ALTER TABLE t1 MODIFY a DOUBLE ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a 0000000000000000000001 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null ALTER TABLE t1 MODIFY a DECIMAL(10,1) ZEROFILL; SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; a 000000001.0 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND WEIGHT_STRING(a) IS NULL; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and weight_string(`test`.`t1`.`a`,0,0,1) is null DROP TABLE t1; # # End of 10.1 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.func_weight_string/' main.function_defaults [ pass ] 545 main.function_defaults_notembedded [ pass ] 68 main.gcc296 [ pass ] 6 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.gis [ fail ] Test ended at 2026-04-22 18:30:25 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-22 18:30:25.483849447 +0300 @@ -238,10 +238,6 @@ 122 GEOMETRYCOLLECTION EMPTY 123 GEOMETRYCOLLECTION EMPTY explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 23 100.00 -Warnings: -Note 1003 select st_dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,st_geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,st_isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,st_astext(st_envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry` SELECT fid, X(g) FROM gis_point; fid X(g) 101 10 @@ -255,10 +251,6 @@ 103 20 104 20 explain extended select X(g),Y(g) FROM gis_point; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00 -Warnings: -Note 1003 select st_x(`test`.`gis_point`.`g`) AS `X(g)`,st_y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point` SELECT fid, AsText(StartPoint(g)) FROM gis_line; fid AsText(StartPoint(g)) 105 POINT(0 0) @@ -290,10 +282,6 @@ 106 1 107 0 explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 select st_astext(st_startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,st_astext(st_endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,st_length(`test`.`gis_line`.`g`) AS `GLength(g)`,st_numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,st_astext(st_pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,st_isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line` SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) @@ -320,10 +308,6 @@ 109 LINESTRING(10 10,20 10,20 20,10 20,10 10) 110 NULL explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 select st_astext(st_centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,st_area(`test`.`gis_polygon`.`g`) AS `Area(g)`,st_astext(st_exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,st_numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,st_astext(st_interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon` SELECT fid, IsClosed(g) FROM gis_multi_line; fid IsClosed(g) 114 0 @@ -361,10 +345,6 @@ 122 0 123 0 explain extended SELECT fid, NumGeometries(g) from gis_multi_point; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,st_numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point` SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; fid AsText(GeometryN(g, 2)) 111 POINT(10 10) @@ -393,10 +373,6 @@ 122 NULL 123 NULL explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 -Warnings: -Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,st_astext(st_geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point` SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -424,11 +400,6 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE g1 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort -1 SIMPLE g2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join) -Warnings: -Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,st_equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( gp point, @@ -467,28 +438,12 @@ exp POINT(1 4) explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))); -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 st_astext(st_geometryfromwkb(st_aswkb(st_geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)')))); -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 st_astext(st_geometryfromwkb(st_aswkb(st_geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); SRID(GeomFromText('LineString(1 1,2 2)',101)) 101 explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); -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 srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); -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 st_issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -963,8 +918,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 @@ -972,22 +925,16 @@ INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(3 4)')); EXPLAIN SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)'); COUNT(*) 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 ref p p 28 const # Using where SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)'); COUNT(*) 1 EXPLAIN SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where SELECT COUNT(*) FROM t2 IGNORE INDEX(p) 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 ] 152 main.gis-json [ pass ] 12 main.gis-loaddata [ pass ] 7 main.gis-precise [ pass ] 10975 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.gis-rt-precise [ fail ] Test ended at 2026-04-22 18:30:54 CURRENT_TEST: main.gis-rt-precise --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis-rt-precise.result 2026-04-02 14:38:09.363657629 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis-rt-precise.reject 2026-04-22 18:30:54.505742187 +0300 @@ -16,8 +16,6 @@ count(*) 150 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 140))')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range g g 34 NULL 8 Using where SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); fid AsText(g) 1 LINESTRING(150 150,150 150) @@ -50,8 +48,6 @@ 100 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range g g 34 NULL 4 Using where SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); fid AsText(g) Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.gis-rt-precise/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.gis-rtree [ fail ] Test ended at 2026-04-22 18:30:57 CURRENT_TEST: main.gis-rtree --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis-rtree.result 2026-04-02 14:38:09.363657629 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/gis-rtree.reject 2026-04-22 18:30:57.577730843 +0300 @@ -191,8 +191,6 @@ count(*) 150 EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range g g 34 NULL 8 Using where SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); fid AsText(g) 1 LINESTRING(150 150,150 150) @@ -325,8 +323,6 @@ 100 EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range g g 34 NULL 4 Using where SELECT fid, AsText(g) FROM t2 WHERE Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); fid AsText(g) @@ -1512,32 +1508,22 @@ (GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), (GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); EXPLAIN SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where SELECT 1 FROM t1 WHERE a = GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); 1 1 1 EXPLAIN SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where SELECT 1 FROM t1 WHERE a < GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); 1 EXPLAIN SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where SELECT 1 FROM t1 WHERE a <= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); 1 1 1 EXPLAIN SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where SELECT 1 FROM t1 WHERE a > GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); 1 EXPLAIN SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)'); 1 1 @@ -1622,17 +1608,9 @@ CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)); INSERT INTO t1 VALUES (Point(1,2)),(Point(1,3)); EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(a,Point(1,2)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 34 NULL 1 Using where EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(a,Point(1,2)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 34 NULL 1 Using where EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(Point(1,2),a); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 34 NULL 1 Using where EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(Point(1,2),a); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 34 NULL 1 Using where DROP TABLE t1; # # MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.gis-rtree/' main.gis_notembedded [ pass ] 56 main.grant5 [ pass ] 224 main.grant_4332 [ pass ] 90 main.grant_binlog_replay [ pass ] 10 main.grant_cache_no_prot [ pass ] 83 main.grant_cache_ps_prot [ skipped ] Need ps-protocol ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'privtest_db' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS privtest_db ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'privtest_db' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS privtest_db ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'privtest_db' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS privtest_db ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'privtest_db' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS privtest_db ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'privtest_db' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS privtest_db main.grant_explain_non_select [ fail ] Test ended at 2026-04-22 18:31:14 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-22 18:31:13.837670839 +0300 @@ -21,12 +21,8 @@ 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 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 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 INSERT INTO t1 SELECT * FROM t2; connection default; REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost'; @@ -66,12 +62,8 @@ GRANT INSERT, DELETE ON privtest_db.t1 TO 'privtest'@'localhost'; connection con1; EXPLAIN REPLACE 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 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 REPLACE INTO t1 SELECT * FROM t2; connection default; REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost'; @@ -111,13 +103,8 @@ GRANT UPDATE, SELECT ON privtest_db.t1 TO 'privtest'@'localhost'; connection con1; EXPLAIN UPDATE t1 SET a = a + 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 UPDATE t1 SET a = a + 1; EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a; connection default; REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost'; @@ -158,13 +145,8 @@ GRANT DELETE, SELECT ON privtest_db.t1 TO 'privtest'@'localhost'; connection con1; EXPLAIN DELETE FROM t1 WHERE a = 10; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where DELETE FROM t1 WHERE a = 10; EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; 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 ] 32 main.grant_lowercase_fs [ skipped ] Test requires: 'case_insensitive_fs' main.grant_master_admin [ pass ] 11 main.grant_plugin [ pass ] 9 main.grant_read_only [ pass ] 21 main.grant_repair [ pass ] 98 main.grant_server [ pass ] 20 main.grant_slave_admin [ pass ] 11 main.grant_slave_monitor [ pass ] 23 main.grant_utf8_cli [ pass ] 71 main.group_by_null [ pass ] 5 main.handler_read_last [ pass ] 13 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.having [ fail ] Test ended at 2026-04-22 18:31:42 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-22 18:31:41.803567773 +0300 @@ -8,10 +8,6 @@ b 0 explain extended select count(a) as b from t1 where a=0 having b >=0; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select count(NULL) AS `b` from dual where 0 having `b` >= 0 drop table t1; CREATE TABLE t1 ( raw_id int(10) NOT NULL default '0', @@ -151,11 +147,7 @@ SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1; x a EXPLAIN SELECT a FROM t1 GROUP BY a HAVING 1 != 1 AND a > 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING EXPLAIN SELECT 0 AS x, a FROM t1 GROUP BY x,a HAVING x=1 AND a > 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING DROP table t1; CREATE TABLE t1 (a int PRIMARY KEY); CREATE TABLE t2 (b int PRIMARY KEY, a int); @@ -464,10 +456,6 @@ WHERE table2.f1 = 2 GROUP BY table1.f1, table2.f2 HAVING (table2.f2 = 8 AND table1.f1 >= 6); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select 0 AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where 0 group by 0,7 having 1 EXPLAIN EXTENDED SELECT table1.f1, table2.f2 FROM t1 AS table1 @@ -475,10 +463,6 @@ WHERE table2.f1 = 2 GROUP BY table1.f1, table2.f2 HAVING (table2.f2 = 8); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where 0 group by `test`.`table1`.`f1`,7 having 1 DROP TABLE t1; # # Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 @@ -590,8 +574,6 @@ MAX(t1.b) EXPLAIN SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a < 0 HAVING MAX(t1.b) <> 6; -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 SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a < 0 HAVING MAX(t1.b) <> 6; MAX(t1.b) CREATE TABLE t3 ( f3 int) ; @@ -621,12 +603,6 @@ FROM t1 , t2 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 -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' set optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; End of 5.2 tests @@ -710,10 +686,6 @@ # explain extended select * from mysql.help_topic where example = 'foo' having description is null; -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 HAVING -Warnings: -Note 1003 select `mysql`.`help_topic`.`help_topic_id` AS `help_topic_id`,`mysql`.`help_topic`.`name` AS `name`,`mysql`.`help_topic`.`help_category_id` AS `help_category_id`,`mysql`.`help_topic`.`description` AS `description`,`mysql`.`help_topic`.`example` AS `example`,`mysql`.`help_topic`.`url` AS `url` from `mysql`.`help_topic` where `mysql`.`help_topic`.`example` = 'foo' having 0 select * from mysql.help_topic where example = 'foo' having description is null; help_topic_id name help_category_id description example url # @@ -833,8 +805,6 @@ 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 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 @@ -977,8 +947,6 @@ WHERE t1.id = 3 GROUP BY t1.a HAVING t1.b = 'b' and t1.c = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables DROP TABLE t1; CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; CREATE TABLE t2 (id INT, b TEXT, c INT) ENGINE=MyISAM; @@ -995,8 +963,6 @@ explain SELECT t2.* FROM t2 LEFT JOIN t1 ON t2.id = t1.a GROUP BY t2.id HAVING t2.b = 'b' and t2.c = 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING noticed after reading const tables DROP TABLE t1,t2; # # End of 10.5 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.having/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.having_cond_pushdown [ fail ] Test ended at 2026-04-22 18:31:45 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-22 18:31:45.533554039 +0300 @@ -24,37 +24,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>2); -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 explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 > 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a>2) @@ -101,32 +74,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a=2); -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 = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=2) @@ -170,37 +121,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (t1.a<4); -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 explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (t1.a<4); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 and t1.a < 4" - } - } - ] - } - } - } -} 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) AND (t1.a<4) @@ -249,41 +173,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) OR (a IN (SELECT 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; Using temporary; Using filesort -Warnings: -Note 1249 Select 2 was reduced during optimization explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) OR (a IN (SELECT 3)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 or t1.a = 3" - } - } - ] - } - } - } -} -Warnings: -Note 1249 Select 2 was reduced during optimization 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) OR (a IN (SELECT 3)) @@ -333,38 +226,10 @@ FROM t1 GROUP BY t1.a HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1)); -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 explain format=json SELECT t1.a,MAX(t1.b),MIN(t1.c) FROM t1 GROUP BY t1.a HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a > 2 and max(t1.b) > 13 or t1.a < 3 and min(t1.c) > 1", - "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 > 2 or t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a>2) OR (t1.a<3) @@ -413,38 +278,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.a)<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; Using temporary; Using filesort explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.a)<3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.a) < 3", - "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" - } - } - ] - } - } - } -} 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) @@ -492,38 +329,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.b)>13); -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 explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.b)>13); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b) > 13", - "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" - } - } - ] - } - } - } -} 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) @@ -571,33 +380,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=3) AND (MAX(t1.a)=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 explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a=3) AND (MAX(t1.a)=3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.a) = 3", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 3" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=3) @@ -640,33 +426,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=2) AND (MAX(t1.b)>12); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a=2) AND (MAX(t1.b)>12); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b) > 12", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=2) @@ -709,38 +472,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.b)=13); -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 explain format=json SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MAX(t1.b)=13); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b) = 13", - "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" - } - } - ] - } - } - } -} 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) @@ -790,38 +525,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MIN(t1.c)<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; Using temporary; Using filesort explain format=json SELECT t1.a,MIN(t1.c) FROM t1 GROUP BY t1.a HAVING (t1.a>1) AND (MIN(t1.c)<3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "min(t1.c) < 3", - "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" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MIN(t1.c) FROM t1 WHERE (t1.a>1) @@ -869,33 +576,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=2) AND (MAX(t1.b)=13) AND (MIN(t1.c)=2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),MIN(t1.c) FROM t1 GROUP BY t1.a HAVING (t1.a=2) AND (MAX(t1.b)=13) AND (MIN(t1.c)=2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b) = 13 and min(t1.c) = 2", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MIN(t1.c) FROM t1 WHERE (t1.a=2) @@ -939,38 +623,10 @@ 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 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" - } - } - ] - } - } - } -} 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) @@ -1024,79 +680,11 @@ WHERE (t2.x=v1.a) GROUP BY v1.a HAVING (v1.a>1); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -1 PRIMARY ref key0 key0 5 test.t2.x 1 -2 DERIVED t1 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort explain format=json SELECT v1.a FROM t2,v1 WHERE (t2.x=v1.a) GROUP BY v1.a HAVING (v1.a>1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "v1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x > 1 and t2.x is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.x"], - "loops": 4, - "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": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1" - } - } - ] - } - } - } - } - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT v1.a FROM t2,v1 WHERE (t2.x=v1.a) AND (v1.a>1) @@ -1187,80 +775,11 @@ WHERE (t2.x=v1.a) GROUP BY v1.c HAVING (v1.c>2); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort -1 PRIMARY ref key0 key0 5 test.t2.x 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort explain format=json SELECT v1.a,v1.c FROM t2,v1 WHERE (t2.x=v1.a) GROUP BY v1.c HAVING (v1.c>2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "v1.c", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.x"], - "loops": 4, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v1.c > 2", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "t1.c > 2", - "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 - } - } - ] - } - } - } - } - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT v1.a,v1.c FROM t2,v1 WHERE (t2.x=v1.a) AND (v1.c>2) @@ -1353,79 +872,11 @@ (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.a HAVING (t1.a>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; Using temporary; Using filesort -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary explain format=json SELECT * FROM t1 WHERE (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.a HAVING (t1.a>1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 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": "8", - "used_key_parts": ["x", "MAX(t2.y)"], - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x < 5 and t2.x > 1" - } - } - ] - } - } - } - } - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT * FROM t1 WHERE (t1.a>1) AND @@ -1516,80 +967,11 @@ (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.b HAVING (t1.b<14); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary explain format=json SELECT * FROM t1 WHERE (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.b HAVING (t1.b<14); -EXPLAIN -{ - "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": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b < 14 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": "8", - "used_key_parts": ["x", "MAX(t2.y)"], - "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", - "having_condition": "`MAX(t2.y)` < 14", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.x < 5" - } - } - ] - } - } - } - } - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT * FROM t1 WHERE (t1.b<14) AND @@ -1678,38 +1060,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.c=2) AND (t1.a>1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 GROUP BY t1.a HAVING (t1.c=2) AND (t1.a>1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.c = 2", - "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" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a>1) GROUP BY t1.a @@ -1756,33 +1110,10 @@ FROM t1 GROUP BY t1.b HAVING (t1.a=2) AND (t1.b=13) AND (t1.c=2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT MAX(t1.a),t1.a,t1.b,t1.c FROM t1 GROUP BY t1.b HAVING (t1.a=2) AND (t1.b=13) AND (t1.c=2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a = 2 and t1.c = 2", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b = 13" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT MAX(t1.a),t1.a,t1.b,t1.c FROM t1 WHERE (t1.b=13) @@ -1826,37 +1157,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=t1.c) AND (t1.c>1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 GROUP BY t1.a HAVING (t1.a=t1.c) AND (t1.c>1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.c = t1.a and t1.a > 1" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=t1.c) AND (t1.a>1) GROUP BY t1.a; @@ -1901,32 +1205,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a=t1.c) AND (t1.c=2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 GROUP BY t1.a HAVING (t1.a=t1.c) AND (t1.c=2); -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 = 2 and t1.c = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.a=2) @@ -1967,38 +1249,10 @@ FROM t1 GROUP BY t1.a HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>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; Using temporary; Using filesort explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 GROUP BY t1.a HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>3)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3 and t1.c > 3", - "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.c = t1.a and t1.a > 1 or t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a=t1.c) AND (t1.a>1)) OR (t1.a<3) @@ -2052,38 +1306,11 @@ WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (t1.c<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; Using temporary; Using filesort explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (t1.c<3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.c = t1.a and t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.c<3) @@ -2133,38 +1360,11 @@ WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (t1.a>1) AND (t1.c<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; Using temporary; Using filesort explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (t1.a>1) AND (t1.c<3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.c = t1.a and t1.a > 1 and t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.a>1) AND (t1.c<3) @@ -2213,39 +1413,11 @@ WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4)) AND (t1.a<2); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) GROUP BY t1.a HAVING (((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4)) AND (t1.a<2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", - "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.c = t1.a and (t1.a > 1 or t1.a < 4) and t1.a < 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (((t1.a>1) OR (t1.c<4)) AND (t1.a<2)) @@ -2299,39 +1471,11 @@ WHERE (t1.a=t1.c) GROUP BY t1.a HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) GROUP BY t1.a HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", - "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.c = t1.a and (t1.a > 1 or t1.a < 4)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND ((t1.a>1) OR (t1.c<4)) @@ -2375,8 +1519,6 @@ a EXPLAIN SELECT a FROM t1 WHERE b = 1 AND b = 2 GROUP BY a HAVING a <= 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE DROP TABLE t1; # # MDEV-18769: unfixed OR condition pushed from HAVING into WHERE @@ -2402,37 +1544,10 @@ FROM t1 GROUP BY t1.a HAVING t1.b = 13 AND MAX(t1.c) > 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a HAVING t1.b = 13 AND MAX(t1.c) > 2; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.b = 13 and max(t1.c) > 2", - "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 - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a @@ -2481,37 +1596,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "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 or t1.b > 10) and t1.b < 14" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14) @@ -2561,37 +1649,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "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 or t1.b > 10) and (t1.b < 14 or t1.b > 15)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15) @@ -2640,37 +1701,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2)); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "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 or t1.b > 10) and (t1.b < 14 or t1.a = 2 and t1.b > 15)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2)) @@ -2721,37 +1755,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2) OR (t1.b = 13 AND t1.a > 2); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2) OR (t1.b = 13 AND t1.a > 2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 2 or t1.b = 13 and t1.a > 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2) OR (t1.b = 13 AND t1.a > 2) @@ -2799,37 +1806,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b = 14 and t1.a < 2 or t1.b = 13 and t1.a > 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13) @@ -2879,37 +1859,10 @@ FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14)); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.b HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b = 14 and t1.a < 2 or t1.a > 2 and (t1.b = 13 or t1.b = 14)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14)) @@ -2955,38 +1908,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a < 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", - "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 < 2 or t1.a = 1 or t1.a = 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2) OR (t1.a = 1 OR t1.a = 2) @@ -3036,38 +1961,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); -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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a = 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", - "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 = 2 or t1.a = 1 or t1.a = 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 2) OR (t1.a = 1 OR t1.a = 2) @@ -3116,33 +2013,10 @@ FROM t1 GROUP BY t1.a HAVING (t1.a = 1) AND (MAX(t1.c) = 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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a HAVING (t1.a = 1) AND (MAX(t1.c) = 3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.c) = 3", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1) @@ -3186,33 +2060,10 @@ FROM t1 GROUP BY t1.a,t1.c HAVING (t1.a = 1) AND (t1.c = 3) AND MAX(t1.b = 14); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.c HAVING (t1.a = 1) AND (t1.c = 3) AND MAX(t1.b = 14); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b = 14)", - "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.c = 3" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) @@ -3255,33 +2106,10 @@ FROM t1 GROUP BY t1.a,t1.c HAVING (t1.a = 1) AND (t1.c = 1) AND MAX(t1.b = 14); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a,t1.c HAVING (t1.a = 1) AND (t1.c = 1) AND MAX(t1.b = 14); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "max(t1.b = 14)", - "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.c = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1) AND (t1.c = 1) @@ -3333,38 +2161,11 @@ WHERE (t1.b > 2) GROUP BY t1.a HAVING (t1.a < 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; Using temporary; Using filesort explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) GROUP BY t1.a HAVING (t1.a < 3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.b > 2 and t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) AND (t1.a < 3) @@ -3414,33 +2215,11 @@ WHERE (t1.b > 2) GROUP BY t1.a HAVING (t1.a = 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 explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) GROUP BY t1.a HAVING (t1.a = 3); -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 = 3 and t1.b > 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) AND (t1.a = 3) @@ -3485,38 +2264,11 @@ WHERE (t1.b = 14) GROUP BY t1.a HAVING (t1.a < 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; Using temporary; Using filesort explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) GROUP BY t1.a HAVING (t1.a < 3); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.b = 14 and t1.a < 3" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) AND (t1.a < 3) @@ -3566,33 +2318,11 @@ WHERE (t1.b = 14) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) GROUP BY t1.a HAVING (t1.a = 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.b = 14" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) AND (t1.a = 1) @@ -3635,22 +2365,11 @@ WHERE (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.c) FROM t1 WHERE (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.c) FROM t1 WHERE (t1.a = 3) AND (t1.a = 1) @@ -3684,33 +2403,11 @@ WHERE (t1.c = 1) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c = 1) GROUP BY t1.a HAVING (t1.a = 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.c = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c = 1) AND (t1.a = 1) @@ -3757,38 +2454,11 @@ WHERE (t1.c > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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.c > 0 and t1.c < 3 and t1.a > 1" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a > 1) @@ -3838,33 +2508,11 @@ WHERE (t1.c > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a = 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.c > 0 and t1.c < 3" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a = 1) @@ -3909,34 +2557,11 @@ WHERE (t1.a > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 0) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a = 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1", - "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.c < 3" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 0) AND (t1.c < 3) AND (t1.a = 1) @@ -3978,22 +2603,11 @@ WHERE (t1.a = 0) AND (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a = 0) AND (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a = 0) AND (t1.a = 3) AND (t1.a = 1) @@ -4026,33 +2640,11 @@ WHERE (t3.b = 2) AND (t3.d = 1) GROUP BY t3.a,t3.b,t3.d HAVING (t3.a = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.b = 2) AND (t3.d = 1) GROUP BY t3.a,t3.b,t3.d HAVING (t3.a = 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.b = 2 and t3.d = 1 and t3.a = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.b = 2) AND (t3.d = 1) AND (t3.a = 1) @@ -4097,38 +2689,11 @@ WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 2); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 or t1.c < 3) and t1.a < 2" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a > 1) OR (t1.c < 3)) AND (t1.a < 2) @@ -4175,22 +2740,11 @@ WHERE (t1.a = 1) OR (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a = 1) OR (t1.a = 3) GROUP BY t1.a HAVING (t1.a = 2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} 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) OR (t1.a = 3)) AND (t1.a = 2) @@ -4226,38 +2780,11 @@ WHERE (t1.a > 1) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.a > 0); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.a > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 and t1.a < 4 and t1.a > 0" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) AND (t1.a < 4) AND (t1.a > 0) @@ -4307,34 +2834,11 @@ WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.a > 0); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.a > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1 and 1", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a < 4) AND (t1.a > 0) @@ -4381,38 +2885,11 @@ WHERE (t1.a > 1) GROUP BY t1.a HAVING (t1.a < 4) OR (t1.a > 0); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) GROUP BY t1.a HAVING (t1.a < 4) OR (t1.a > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "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 and (t1.a < 4 or t1.a > 0)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) AND ((t1.a < 4) OR (t1.a > 0)) @@ -4462,34 +2939,11 @@ WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.a < 4) OR (t1.a > 0); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.a < 4) OR (t1.a > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND ((t1.a < 4) OR (t1.a > 0)) @@ -4536,39 +2990,11 @@ WHERE (t1.a > 1) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.c > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) AND (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.c > 1", - "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 and t1.c < 3 and t1.a < 4" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a > 1) AND (t1.c < 3)) AND @@ -4618,39 +3044,11 @@ WHERE (t1.a = 1) AND (t1.c < 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.c < 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1", - "filesort": { - "sort_key": "t1.c", - "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 and t1.c < 3 and t1.c > 1" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a = 1) AND (t1.c < 3)) AND @@ -4700,34 +3098,11 @@ WHERE (t1.a = 1) AND (t1.c = 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1 and 1", - "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.c = 3" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a = 1) AND (t1.c = 3)) AND @@ -4772,34 +3147,11 @@ WHERE (t3.a = 1) AND (t3.d = 1) GROUP BY t3.a,t3.b HAVING (t3.b = 2) AND (t3.d > 0); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.a = 1) AND (t3.d = 1) GROUP BY t3.a,t3.b HAVING (t3.b = 2) AND (t3.d > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t3.d > 0", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.a = 1) AND (t3.d = 1) AND @@ -4846,34 +3198,11 @@ WHERE (t3.a = 1) AND (t3.d = 1) GROUP BY t3.a,t3.b,t3.d HAVING (t3.b = 2) AND (t3.d > 0); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.a = 1) AND (t3.d = 1) GROUP BY t3.a,t3.b,t3.d HAVING (t3.b = 2) AND (t3.d > 0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "const_condition": "1", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.a = 1) AND (t3.d = 1) AND @@ -4921,39 +3250,11 @@ WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.c > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a HAVING (t1.a < 4) AND (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.c > 1", - "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 or t1.c < 3) and t1.a < 4" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a > 1) OR (t1.c < 3)) AND @@ -5009,38 +3310,11 @@ WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) OR (t1.c < 3) GROUP BY t1.a,t1.c HAVING (t1.a < 4) AND (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.c", - "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 or t1.c < 3) and t1.a < 4 and t1.c > 1" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a > 1) OR (t1.c < 3)) AND @@ -5094,38 +3368,11 @@ WHERE (t1.a = 1) OR (t1.a = 3) GROUP BY t1.a,t1.c HAVING (t1.a = 4) OR (t1.c > 1); -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 explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) OR (t1.a = 3) GROUP BY t1.a,t1.c HAVING (t1.a = 4) OR (t1.c > 1); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.c", - "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 or t1.a = 3) and (t1.a = 4 or t1.c > 1)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a = 1) OR (t1.a = 3)) AND @@ -5176,33 +3423,11 @@ WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 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.c = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND (t1.c = 1) @@ -5247,33 +3472,11 @@ WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 1) OR (t1.c = 2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 1) OR (t1.c = 2); -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.c = 1" - } - } - ] - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND @@ -5317,22 +3520,11 @@ WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 3) OR (t1.c = 2); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) GROUP BY t1.a HAVING (t1.c = 3) OR (t1.c = 2); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND @@ -5365,22 +3557,11 @@ WHERE (t1.a = 1) GROUP BY t1.a,t1.c HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) GROUP BY t1.a,t1.c HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) AND @@ -5412,22 +3593,11 @@ WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) GROUP BY t1.a HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "table": { - "message": "Impossible WHERE" - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) AND @@ -5460,38 +3630,11 @@ WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) GROUP BY t3.a HAVING (t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using temporary; Using filesort explain format=json SELECT t3.a,MAX(t3.b),t3.c,t3.d FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) GROUP BY t3.a HAVING (t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t3.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.a = 1 or t3.a > 1)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t3.a,MAX(t3.c),t3.d FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND @@ -5540,38 +3683,11 @@ WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) GROUP BY t3.a HAVING (t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1)); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using temporary; Using filesort explain format=json SELECT t3.a,MAX(t3.b),t3.c,t3.d FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) GROUP BY t3.a HAVING (t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1)); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t3.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.c = t3.a and t3.c < 15 or t3.a > 1)" - } - } - ] - } - } - } -} set statement optimizer_switch='condition_pushdown_from_having=off' for explain format=json SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND @@ -5661,38 +3777,9 @@ explain extended select d1 from t1 group by d1 having d1 between (inet_aton('1978-04-27')) and '2018-08-26'; -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; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`d1` AS `d1` from `test`.`t1` where `test`.`t1`.`d1` between (inet_aton('1978-04-27')) and ('2018-08-26') group by `test`.`t1`.`d1` having 1 explain format=json select d1 from t1 group by d1 having d1 between (inet_aton('1978-04-27')) and '2018-08-26'; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.d1", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.d1 between (inet_aton('1978-04-27')) and ('2018-08-26')" - } - } - ] - } - } - } -} delete from t1; insert into t1 values ('2018-01-15'),('2018-02-20'); select d1 from t1 @@ -5706,38 +3793,9 @@ explain extended select d1 from t1 group by d1 having d1 not between 0 AND exp(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 Using where; Using temporary; Using filesort -Warnings: -Note 1003 select `test`.`t1`.`d1` AS `d1` from `test`.`t1` where `test`.`t1`.`d1` not between (0) and (exp(0)) group by `test`.`t1`.`d1` having 1 explain format=json select d1 from t1 group by d1 having d1 not between 0 AND exp(0); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.d1", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.d1 not between (0) and (exp(0))" - } - } - ] - } - } - } -} drop table t1; # # MDEV-19245: Impossible WHERE should be noticed earlier @@ -5747,40 +3805,22 @@ INSERT INTO t1 VALUES (1,2,1),(3,2,2),(5,6,4),(3,4,1); EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE t1.a > 3 GROUP BY t1.a HAVING t1.a = 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE t1.a = 3 GROUP BY t1.a HAVING t1.a > 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE t1.a > 3 AND t1.a = 3 GROUP BY t1.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 EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a < 2 OR t1.c > 1) GROUP BY t1.a HAVING t1.a = 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE t1.a = 3 GROUP BY t1.a HAVING (t1.a < 2 OR t1.a > 3); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE EXPLAIN SELECT t1.a,MAX(t1.b) FROM t1 WHERE t1.a = 3 AND (t1.a < 2 OR t1.a > 3) GROUP BY t1.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 EXPLAIN SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a < 2 AND t1.c > 1) GROUP BY t1.a HAVING t1.a = 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE EXPLAIN SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE t1.a = 3 GROUP BY t1.a HAVING (t1.a < 2 AND t1.c > 1); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE EXPLAIN SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE t1.a = 3 AND (t1.a < 2 AND t1.b > 3) GROUP BY t1.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 DROP TABLE t1; # # MDEV-21184: Constant subquery in condition movable to WHERE @@ -5791,197 +3831,21 @@ CREATE TABLE t2 (c INT); INSERT INTO t2 VALUES (2),(3); EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a HAVING a = 8 OR a = ( SELECT MIN(c) FROM t2 ); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "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 = 8 or t1.a = (subquery#2)" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } - } -} SELECT a FROM t1 GROUP BY a HAVING a = 8 OR a = ( SELECT MIN(c) FROM t2 ); a 2 EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a,b HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and b < 20; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "filesort": { - "sort_key": "t1.a, t1.b", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.a = 8 or t1.a = (subquery#2)) and t1.b < 20" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } - } -} SELECT a FROM t1 GROUP BY a,b HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and b < 20; a EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and SUM(b) > 20; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "sum(t1.b) > 20", - "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 = 8 or t1.a = (subquery#2)" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } - } -} SELECT a FROM t1 GROUP BY a HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and SUM(b) > 20; a 2 EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a HAVING a = ( SELECT MIN(c) FROM t2 ); -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 = (subquery#2)" - } - } - ], - "subqueries": [ - { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 2, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } -} SELECT a FROM t1 GROUP BY a HAVING a = ( SELECT MIN(c) FROM t2 ); a 2 @@ -6047,102 +3911,12 @@ INSERT INTO t1 VALUES (3, 3, 4), (NULL, NULL, 2); EXPLAIN FORMAT=JSON SELECT a,b,c FROM t1 GROUP BY a,b,c HAVING a = (SELECT MIN(b) AS min_b FROM t1) and (a = b or a = c); -EXPLAIN -{ - "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 - } - } - ] - } - } - ] - } - } - } -} SELECT a,b,c FROM t1 GROUP BY a,b,c HAVING a = (SELECT MIN(b) AS min_b FROM t1) and (a = b or a = c); a b c 3 3 4 EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a,b HAVING a = (SELECT MIN(a) AS min_a FROM t1) AND (a = 3 or a > b); -EXPLAIN -{ - "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 - } - } - ] - } - } - ] - } - } - } -} SELECT a FROM t1 GROUP BY a,b HAVING a = (SELECT MIN(a) AS min_a FROM t1) AND (a = 3 or a > b); a @@ -6187,52 +3961,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM t1 GROUP BY b HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a = (subquery#2)", - "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": "(subquery#2) + t1.b = 3" - } - } - ], - "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 * FROM t1 GROUP BY b HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3; @@ -6241,52 +3969,6 @@ EXPLAIN FORMAT=JSON SELECT * FROM t1 GROUP BY b HAVING (SELECT MAX(b) FROM t1) = a AND a > b; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "having_condition": "t1.a = (subquery#2)", - "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": "(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 - } - } - ] - } - } - ] - } - } - } -} SELECT * FROM t1 GROUP BY b HAVING (SELECT MAX(b) FROM t1) = a AND 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 ] 198 main.identifier [ pass ] 43 main.implicit_char_to_num_conversion [ pass ] 51 main.in_datetime_241 [ pass ] 5 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.in_subq_cond_pushdown [ fail ] Test ended at 2026-04-22 18:31:58 CURRENT_TEST: main.in_subq_cond_pushdown --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/in_subq_cond_pushdown.result 2026-04-02 14:38:09.374657600 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/in_subq_cond_pushdown.reject 2026-04-22 18:31:58.721505500 +0300 @@ -40,73 +40,9 @@ EXPLAIN SELECT * FROM t1 WHERE t1.c<25 AND (t1.a,t1.c) IN (SELECT t2.e,MAX(t2.g) FROM t2 WHERE t2.e<5 GROUP BY t2.e); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.c<25 AND (t1.a,t1.c) IN (SELECT t2.e,MAX(t2.g) FROM t2 WHERE t2.e<5 GROUP BY t2.e); -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c < 25 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` < 25", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted AND formula : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.c>55 AND t1.b<4 AND @@ -142,10 +78,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.c>55 AND t1.b<4 AND (t1.a,t1.b,t1.c) IN @@ -156,66 +88,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c > 55 and t1.b < 4 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` > 55 and t2.f < 4", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted OR formula : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.c>60 OR t1.c<25) AND @@ -253,10 +125,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.c>60 OR t1.c<25) AND (t1.a,t1.b,t1.c) IN @@ -267,66 +135,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.c > 60 or t1.c < 25) and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted AND-OR formula : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE ((t1.c>60 OR t1.c<25) AND t1.b>2) AND @@ -362,10 +170,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.c>60 OR t1.c<25) AND t1.b>2) AND (t1.a,t1.b,t1.c) IN @@ -376,66 +180,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.c > 60 or t1.c < 25) and t1.b > 2 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "(`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25) and t2.f > 2", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE ((t1.a<2 OR t1.d>3) AND t1.b>1) AND @@ -473,10 +217,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.a<2 OR t1.d>3) AND t1.b>1) AND (t1.a,t1.b,t1.c) IN @@ -487,66 +227,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.a < 2 or t1.d > 3) and t1.b > 1 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "t2.f > 1", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # using view IN subquery defINition : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.c>20 AND @@ -582,10 +262,6 @@ GROUP BY v1_x ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.c>20 AND (t1.a,t1.c) IN @@ -596,66 +272,6 @@ GROUP BY v1_x ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c > 20 and t1.a is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["v1_x", "MAX(v1_y)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(v1_y)` > 20", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.x > 1 and t3.x <= 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # using equality : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1,v1 WHERE t1.c>20 AND t1.c=v1_y AND @@ -691,11 +307,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where; Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t3.y 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1,v1 WHERE t1.c>20 AND t1.c=v1_y AND (t1.a,t1.c) IN @@ -706,82 +317,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.y > 20 and t3.x <= 3 and t3.y is not null" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 8, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "119", - "join_type": "BNL", - "attached_condition": "t1.c = t3.y and t1.a 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(t2.g)"], - "ref": ["test.t1.a", "test.t3.y"], - "loops": 128, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` > 20", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.a<2 AND @@ -819,10 +354,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a<2 AND (t1.a,t1.c) IN @@ -833,65 +364,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 2 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e < 2" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted AND formula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.a>2 AND t1.a<5 AND @@ -929,10 +401,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>2 AND t1.a<5 AND (t1.a,t1.c) IN @@ -943,65 +411,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 2 and t1.a < 5 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e > 2 and t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted OR formula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a<2 OR t1.a>=4) AND @@ -1041,10 +450,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a<2 OR t1.a>=4) AND (t1.a,t1.c) IN @@ -1055,65 +460,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.a < 2 or t1.a >= 4) and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e >= 4)" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted AND-OR formula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND @@ -1149,10 +495,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND (t1.a,t1.b,t1.c) IN @@ -1163,65 +505,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # extracted AND-OR formula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND @@ -1257,10 +540,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND (t1.a,t1.b,t1.c) IN @@ -1271,65 +550,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE ((t1.b<3 OR t1.d>2) AND t1.a<2) AND @@ -1365,10 +585,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.b<3 OR t1.d>2) AND t1.a<2) AND (t1.a,t1.b,t1.c) IN @@ -1379,65 +595,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.b < 3 or t1.d > 2) and t1.a < 2 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e < 2" - } - } - ] - } - } - } - } - } - } - ] - } -} # using equalities : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.d=1 AND t1.a=t1.d AND @@ -1473,10 +630,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 const,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.d=1 AND t1.a=t1.d AND (t1.a,t1.c) IN @@ -1487,63 +640,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a = 1 and t1.d = 1 and t1.c 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(t2.g)"], - "ref": ["const", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e = 1" - } - } - ] - } - } - } - } - } - ] - } -} # using equality : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.d>1 AND t1.a=t1.d AND @@ -1579,10 +675,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.d>1 AND t1.a=t1.d AND (t1.a,t1.c) IN @@ -1593,65 +685,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.d = t1.a and t1.a > 1 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e > 1" - } - } - ] - } - } - } - } - } - } - ] - } -} # using view IN subquery definition : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE t1.a<3 AND @@ -1685,10 +718,6 @@ GROUP BY v1_x ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a<3 AND (t1.a,t1.c) IN @@ -1699,65 +728,6 @@ GROUP BY v1_x ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a < 3 and t1.a is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["v1_x", "MAX(v1_y)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.x > 1 and t3.x <= 3 and t3.x < 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # using equality : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1,v1 WHERE t1.a=v1_x AND v1_x<2 AND v1_y>30 AND @@ -1795,11 +765,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where; Using join buffer (flat, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t3.x,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1,v1 WHERE t1.a=v1_x AND v1_x<2 AND v1_y>30 AND (t1.a,t1.c) IN @@ -1810,81 +775,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.x < 2 and t3.y > 30 and t3.x <= 3 and t3.x is not null" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 8, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "119", - "join_type": "BNL", - "attached_condition": "t1.a = t3.x and t1.c 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(t2.g)"], - "ref": ["test.t3.x", "test.t1.c"], - "loops": 128, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e <= 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE # extracted OR formula : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 @@ -1921,10 +811,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE ((t1.b<3 OR t1.b=4) AND t1.a<3) AND (t1.a,t1.b,t1.c) IN @@ -1935,66 +821,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "(t1.b < 3 or t1.b = 4) and t1.a < 3 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "t2.f < 3 or t2.f = 4", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e < 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using addition : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a+t1.c>41) AND @@ -2030,10 +856,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a+t1.c>41) AND (t1.a,t1.c) IN @@ -2044,66 +866,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a + t1.c > 41 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "t2.e + `MAX(t2.g)` > 41", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using substitution : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.c-t1.a<35) AND @@ -2141,10 +903,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.c-t1.a<35) AND (t1.a,t1.c) IN @@ -2155,66 +913,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c - t1.a < 35 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` - t2.e < 35", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using multiplication : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.c*t1.a>100) AND @@ -2250,10 +948,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.c*t1.a>100) AND (t1.a,t1.c) IN @@ -2264,66 +958,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c * t1.a > 100 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` * t2.e > 100", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using division : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.c/t1.a>30) AND @@ -2363,10 +997,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.c/t1.a>30) AND (t1.a,t1.c) IN @@ -2377,66 +1007,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c / t1.a > 30 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` / t2.e > 30", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using BETWEEN : pushing into HAVING SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.c BETWEEN 50 AND 100) AND @@ -2472,10 +1042,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.c BETWEEN 50 AND 100) AND (t1.a,t1.c) IN @@ -2486,66 +1052,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c between 50 and 100 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "`MAX(t2.g)` between 50 and 100", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using addition : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a+t1.b > 5) AND @@ -2581,10 +1087,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a+t1.b > 5) AND (t1.a,t1.b,t1.c) IN @@ -2595,65 +1097,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a + t1.b > 5 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e + t2.f > 5" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using substitution : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a-t1.b > 0) AND @@ -2689,10 +1132,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a-t1.b > 0) AND (t1.a,t1.b,t1.c) IN @@ -2703,65 +1142,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a - t1.b > 0 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e - t2.f > 0" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using multiplication : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a*t1.b > 6) AND @@ -2797,10 +1177,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a*t1.b > 6) AND (t1.a,t1.b,t1.c) IN @@ -2811,65 +1187,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a * t1.b > 6 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e * t2.f > 6" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using division : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.b/t1.a > 2) AND @@ -2907,10 +1224,6 @@ GROUP BY t2.e,t2.f ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.b/t1.a > 2) AND (t1.a,t1.b,t1.c) IN @@ -2921,65 +1234,6 @@ GROUP BY t2.e,t2.f ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b / t1.a > 2 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.f / t2.e > 2" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula using BETWEEN : pushing into WHERE SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 WHERE (t1.a BETWEEN 1 AND 3) AND @@ -3021,10 +1275,6 @@ GROUP BY t2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.a BETWEEN 1 AND 3) AND (t1.a,t1.c) IN @@ -3035,65 +1285,6 @@ GROUP BY t2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a between 1 and 3 and t1.a is not null and t1.c 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(t2.g)"], - "ref": ["test.t1.a", "test.t1.c"], - "loops": 16, - "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": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e between 1 and 3" - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into HAVING of the IN subquery # conjunctive subformula : pushing into WHERE of the view from the IN subquery SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 @@ -3132,11 +1323,6 @@ GROUP BY v2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.c>3 AND (t1.a,t1.b,t1.c) IN @@ -3147,91 +1333,6 @@ GROUP BY v2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c > 3 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(v2.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "v2.max_g > 3", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.e < 5", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE of the IN subquery # conjunctive subformula : pushing into WHERE of the view # from the IN subquery @@ -3269,11 +1370,6 @@ GROUP BY v2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>1 AND (t1.a,t1.b,t1.c) IN @@ -3284,90 +1380,6 @@ GROUP BY v2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(v2.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.e < 5 and v2.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e > 1" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE and HAVING # of the IN subquery # conjunctive subformula : pushing into WHERE of the view @@ -3406,11 +1418,6 @@ GROUP BY v2.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>1 AND t1.c<100 AND (t1.a,t1.b,t1.c) IN @@ -3421,91 +1428,6 @@ GROUP BY v2.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.c < 100 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(v2.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "v2.max_g < 100", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "v2.e < 5 and v2.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25", - "filesort": { - "sort_key": "t2.e", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.e > 1" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE of the IN subquery # extracted AND formula : pushing into HAVING of the derived table # from the IN subquery @@ -3561,11 +1483,6 @@ GROUP BY d_tab.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>1 AND (t1.a,t1.b,t1.c) IN @@ -3582,89 +1499,6 @@ GROUP BY d_tab.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.e < 5 and d_tab.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", - "filesort": { - "sort_key": "t2.f", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into HAVING of the derived table # conjunctive subformula : pushing into WHERE of the IN subquery from # the derived table @@ -3739,11 +1573,6 @@ GROUP BY d_tab.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>1 AND (t1.a,t1.b,t1.c) IN @@ -3760,89 +1589,6 @@ GROUP BY d_tab.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.e < 5 and d_tab.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", - "filesort": { - "sort_key": "t2.f", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE of the derived table # extracted AND formula : pushing into WHERE of the IN subquery from # the derived table @@ -3918,11 +1664,6 @@ GROUP BY d_tab.e ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -2 MATERIALIZED ALL NULL NULL NULL NULL 12 Using where; Using temporary -3 DERIVED t2 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE t1.a>1 AND (t1.a,t1.b,t1.c) IN @@ -3939,89 +1680,6 @@ GROUP BY d_tab.e ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "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": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.e < 5 and d_tab.e > 1", - "materialized": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", - "filesort": { - "sort_key": "t2.f", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE and HAVING # of the derived table # extracted AND formula : pushing into WHERE of the IN subquery @@ -4078,12 +1736,6 @@ GROUP BY t1.a ) AS d_tab WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where -1 PRIMARY ref key0 key0 5 test.t3.x 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 16 Using where; Using temporary; Using filesort -2 DERIVED eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t3, ( @@ -4100,107 +1752,6 @@ GROUP BY t1.a ) AS d_tab WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.x < 5 and t3.x is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.x"], - "loops": 8, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.max_c < 70", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "max_c < 70", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "t2.f < 5", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e > 1 and t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE of the derived table # conjunctive subformula : pushing into HAVING of the IN subquery from # the derived table @@ -4278,12 +1829,6 @@ GROUP BY t1.a ) AS d_tab WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where -1 PRIMARY ref key0 key0 5 test.t3.x 1 Using where -2 DERIVED t1 ALL NULL NULL NULL NULL 16 Using where; Using temporary; Using filesort -2 DERIVED eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t3, ( @@ -4300,107 +1845,6 @@ GROUP BY t1.a ) AS d_tab WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 8, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t3.x < 5 and t3.x is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "ref", - "possible_keys": ["key0"], - "key": "key0", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t3.x"], - "loops": 8, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "d_tab.max_c < 70", - "materialized": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "having_condition": "max_c < 70", - "filesort": { - "sort_key": "t1.a", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": ["e", "f", "MAX(t2.g)"], - "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 3, - "cost": "COST_REPLACED", - "having_condition": "t2.f < 5", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e > 1 and t2.e < 5" - } - } - ] - } - } - } - } - } - } - ] - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE # using WINDOW FUNCTIONS : using MAX function SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 @@ -4440,10 +1884,6 @@ WHERE t2.e<5 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 8 test.t1.b,test.t1.c 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.b>1) AND (t1.b, t1.c) IN @@ -4453,74 +1893,6 @@ WHERE t2.e<5 ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "8", - "used_key_parts": ["f", "MAX(t2.g) OVER (PARTITION BY t2.f)"], - "ref": ["test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.f" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.f > 1" - } - } - ] - } - } - } - } - } - } - } - ] - } -} # conjunctive subformula : pushing into WHERE # using WINDOW FUNCTIONS : using SUM function SET STATEMENT optimizer_switch='condition_pushdown_for_subquery=off' FOR SELECT * FROM t1 @@ -4554,10 +1926,6 @@ WHERE t2.e<5 ) ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 16 Using where -1 PRIMARY eq_ref distinct_key distinct_key 12 test.t1.b,test.t1.c 1 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE (t1.b>1) AND (t1.b, t1.c) IN @@ -4567,78 +1935,6 @@ WHERE t2.e<5 ) ; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 16, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null" - } - }, - { - "table": { - "table_name": "", - "access_type": "eq_ref", - "possible_keys": ["distinct_key"], - "key": "distinct_key", - "key_length": "12", - "used_key_parts": [ - "f", - "CAST(SUM(t2.g) OVER (PARTITION BY t2.f) AS INT)" - ], - "ref": ["test.t1.b", "test.t1.c"], - "loops": 16, - "rows": 1, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.c = ``.`CAST(SUM(t2.g) OVER (PARTITION BY t2.f) AS INT)`", - "materialized": { - "unique": 1, - "materialization": { - "query_block": { - "select_id": 2, - "cost": "COST_REPLACED", - "window_functions_computation": { - "sorts": [ - { - "filesort": { - "sort_key": "t2.f" - } - } - ], - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 12, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t2.e < 5 and t2.f > 1" - } - } - ] - } - } - } - } - } - } - } - ] - } -} DROP TABLE t1,t2,t3; DROP VIEW v1,v2; # Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.in_subq_cond_pushdown/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'world' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS world ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.index_intersect [ fail ] Test ended at 2026-04-22 18:32:04 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-22 18:32:04.254485145 +0300 @@ -64,23 +64,15 @@ EXPLAIN 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 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 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 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 SELECT * FROM City USE INDEX () WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -361,18 +353,12 @@ EXPLAIN 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 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 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 SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -462,30 +448,20 @@ EXPLAIN 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 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 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 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 index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); 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 Population,Country 4,3 NULL # Using sort_intersect(Population,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 @@ -696,34 +672,22 @@ EXPLAIN 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 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 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 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 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 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 Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -851,18 +815,12 @@ EXPLAIN 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 EXPLAIN SELECT * FROM City WHERE Country='USA' 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 EXPLAIN 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 SELECT * FROM City USE INDEX () WHERE Country LIKE 'M%' AND Population > 1000000; ID Name Country Population @@ -933,9 +891,6 @@ SELECT * FROM City, Country 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 # DROP DATABASE world; use test; CREATE TABLE t1 ( @@ -962,8 +917,6 @@ EXPLAIN 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 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 ] 53 main.information_schema_chmod [ pass ] 5 main.information_schema_columns [ pass ] 11 main.information_schema_linux [ pass ] 4 main.information_schema_parameters [ pass ] 86 main.information_schema_prepare [ pass ] 5 main.information_schema_routines [ pass ] 88 main.information_schema_stats [ pass ] 32 main.init_file_set_password-7656 [ pass ] 1434 main.insert [ pass ] 1997 main.insert_notembedded [ pass ] 63 main.insert_returning_datatypes [ pass ] 11 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.insert_select [ fail ] Test ended at 2026-04-22 18:32:40 CURRENT_TEST: main.insert_select --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_select.result 2026-04-02 14:38:09.380657583 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_select.reject 2026-04-22 18:32:40.465352067 +0300 @@ -785,9 +785,6 @@ INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); EXPLAIN SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY t1 ref ix_c ix_c 43 const 1 Using where SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') 13 @@ -1052,9 +1049,6 @@ select dt2.id from (select id from t1) dt2, t1 t where t.id=dt2.id ) dt where dt.id=3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary -1 SIMPLE t ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) explain format=json insert into t1 select 1,10 from @@ -1062,44 +1056,6 @@ select dt2.id from (select id from t1) dt2, t1 t where t.id=dt2.id ) dt where dt.id=3; -EXPLAIN -{ - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "temporary_table": { - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t1.`id` = 3" - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t", - "access_type": "ALL", - "loops": 4, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100, - "attached_condition": "t.`id` = 3" - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL" - } - } - ] - } - } -} prepare stmt from "insert into t1 select 1,10 from Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.insert_select/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.insert_update [ fail ] Test ended at 2026-04-22 18:32:45 CURRENT_TEST: main.insert_update --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_update.result 2026-04-17 18:40:40.429798068 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/insert_update.reject 2026-04-22 18:32:45.526333486 +0300 @@ -57,15 +57,7 @@ 8 9 60 NULL 2 1 11 NULL explain extended SELECT *, VALUE(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 5 100.00 -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,value(`test`.`t1`.`a`) AS `VALUE(a)` from `test`.`t1` explain extended select * from t1 where value(a); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where -Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where value(`test`.`t1`.`a`) DROP TABLE t1; create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.insert_update/' main.insert_update_autoinc-7150 [ pass ] 37 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.intersect [ fail ] Test ended at 2026-04-22 18:32:56 CURRENT_TEST: main.intersect --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect.result 2026-04-02 14:38:09.381657581 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/intersect.reject 2026-04-22 18:32:55.916587195 +0300 @@ -18,96 +18,9 @@ a b 2 2 EXPLAIN (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -2 INTERSECT t2 ALL NULL NULL NULL NULL 3 -3 INTERSECT t3 ALL NULL NULL NULL NULL 3 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL EXPLAIN extended (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); -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 -2 INTERSECT t2 ALL NULL NULL NULL NULL 3 100.00 -3 INTERSECT t3 ALL NULL NULL NULL NULL 3 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect (/* select#3 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`) EXPLAIN extended select * from ((select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3)) a; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 3 100.00 -4 INTERSECT t3 ALL NULL NULL NULL NULL 3 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `a`.`a` AS `a`,`a`.`b` AS `b` from ((/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect (/* select#3 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect (/* select#4 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `a` EXPLAIN format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); -EXPLAIN -{ - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 2, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } -} ANALYZE format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); ANALYZE { @@ -355,93 +268,10 @@ a b 2 2 EXPLAIN (select a,b from t1) intersect (select c,e from t2,t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -2 INTERSECT t2 ALL NULL NULL NULL NULL 3 -2 INTERSECT t3 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL EXPLAIN extended (select a,b from t1) intersect (select c,e from t2,t3); -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 -2 INTERSECT t2 ALL NULL NULL NULL NULL 3 100.00 -2 INTERSECT t3 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t3`.`e` AS `e` from `test`.`t2` join `test`.`t3`) EXPLAIN extended select * from ((select a,b from t1) intersect (select c,e from t2,t3)) a; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 3 100.00 -3 INTERSECT t3 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `a`.`a` AS `a`,`a`.`b` AS `b` from ((/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect (/* select#3 */ select `test`.`t2`.`c` AS `c`,`test`.`t3`.`e` AS `e` from `test`.`t2` join `test`.`t3`)) `a` set @@optimizer_switch='optimize_join_buffer_size=off'; EXPLAIN format=json (select a,b from t1) intersect (select c,e from t2,t3); -EXPLAIN -{ - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 2, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 3, - "rows": 3, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "256Kb", - "join_type": "BNL" - } - } - ] - } - } - ] - } - } -} ANALYZE format=json (select a,b from t1) intersect (select c,e from t2,t3); ANALYZE { @@ -790,16 +620,6 @@ 6 6 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 t1 ALL NULL NULL NULL NULL 2 100.00 -5 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 -3 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -4 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 `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union /* select#5 */ select `__5`.`c` AS `c`,`__5`.`d` AS `d` from ((/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect (/* select#3 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `__5` union (/* select#4 */ select 4 AS `4`,4 AS `4`) (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 @@ -808,14 +628,6 @@ 6 6 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 t3 ALL NULL NULL NULL NULL 2 100.00 -2 INTERSECT t2 ALL NULL NULL NULL NULL 2 100.00 -3 UNION t1 ALL NULL NULL NULL NULL 2 100.00 -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`) intersect (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) union (/* select#3 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union (/* select#4 */ select 4 AS `4`,4 AS `4`) (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union /* select#3 */ select `__3`.`c` AS `c`,`__3`.`d` AS `d` from ((/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect (/* select#4 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `__3` union (/* select#5 */ select 4 AS `4`,4 AS `4`); a b 3 3 @@ -1010,12 +822,4 @@ select * from t2 where a < 5 intersect select * from t3 where a < 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 Using where -4 UNION ALL NULL NULL NULL NULL 6 100.00 -2 DERIVED t2 ALL NULL NULL NULL NULL 6 100.00 Using where -3 INTERSECT t3 ALL NULL NULL NULL NULL 7 100.00 Using where -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 union all /* select#4 */ select `__4`.`a` AS `a` from (/* select#2 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where `test`.`t2`.`a` < 5 intersect /* select#3 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where `test`.`t3`.`a` < 5) `__4` drop table t1,t2,t3; Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.intersect/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.intersect_all [ fail ] Test ended at 2026-04-22 18:33:10 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-22 18:33:10.455242026 +0300 @@ -30,96 +30,9 @@ 2 2 2 2 EXPLAIN (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 INTERSECT t2 ALL NULL NULL NULL NULL 4 -3 INTERSECT t3 ALL NULL NULL NULL NULL 4 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL EXPLAIN extended (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); -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 -2 INTERSECT t2 ALL NULL NULL NULL NULL 4 100.00 -3 INTERSECT t3 ALL NULL NULL NULL NULL 4 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect all (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect all (/* select#3 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`) EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3)) a; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 -2 DERIVED t1 ALL NULL NULL NULL NULL 4 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 4 100.00 -4 INTERSECT t3 ALL NULL NULL NULL NULL 4 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `a`.`a` AS `a`,`a`.`b` AS `b` from ((/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect all (/* select#3 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect all (/* select#4 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `a` EXPLAIN format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); -EXPLAIN -{ - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "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 - } - } - ] - } - }, - { - "query_block": { - "select_id": 2, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 3, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 4, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - } - ] - } - } -} ANALYZE format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); ANALYZE { @@ -387,92 +300,9 @@ 2 2 2 2 EXPLAIN (select a,b from t1) intersect all (select c,e from t2,t3); -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 6 -2 INTERSECT t3 ALL NULL NULL NULL NULL 5 -2 INTERSECT t2 ALL NULL NULL NULL NULL 7 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL EXPLAIN extended (select a,b from t1) intersect all (select c,e from t2,t3); -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 -2 INTERSECT t3 ALL NULL NULL NULL NULL 5 100.00 -2 INTERSECT t2 ALL NULL NULL NULL NULL 7 100.00 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect all (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t3`.`e` AS `e` from `test`.`t2` join `test`.`t3`) EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,e from t2,t3)) a; -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 -3 INTERSECT t3 ALL NULL NULL NULL NULL 5 100.00 -3 INTERSECT t2 ALL NULL NULL NULL NULL 7 100.00 Using join buffer (flat, BNL join) -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `a`.`a` AS `a`,`a`.`b` AS `b` from ((/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) intersect all (/* select#3 */ select `test`.`t2`.`c` AS `c`,`test`.`t3`.`e` AS `e` from `test`.`t2` join `test`.`t3`)) `a` EXPLAIN format=json (select a,b from t1) intersect all (select c,e from t2,t3); -EXPLAIN -{ - "query_block": { - "union_result": { - "table_name": "", - "access_type": "ALL", - "query_specifications": [ - { - "query_block": { - "select_id": 1, - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t1", - "access_type": "ALL", - "loops": 1, - "rows": 6, - "cost": "COST_REPLACED", - "filtered": 100 - } - } - ] - } - }, - { - "query_block": { - "select_id": 2, - "operation": "INTERSECT", - "cost": "COST_REPLACED", - "nested_loop": [ - { - "table": { - "table_name": "t3", - "access_type": "ALL", - "loops": 1, - "rows": 5, - "cost": "COST_REPLACED", - "filtered": 100 - } - }, - { - "block-nl-join": { - "table": { - "table_name": "t2", - "access_type": "ALL", - "loops": 5, - "rows": 7, - "cost": "COST_REPLACED", - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL" - } - } - ] - } - } - ] - } - } -} ANALYZE format=json (select a,b from t1) intersect all (select c,e from t2,t3); ANALYZE { @@ -835,15 +665,6 @@ 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); -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 -5 UNION ALL NULL NULL NULL NULL 2 100.00 -2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 -3 INTERSECT t3 ALL NULL NULL NULL NULL 2 100.00 -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union all /* select#5 */ select `__5`.`c` AS `c`,`__5`.`d` AS `d` from ((/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect all (/* select#3 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `__5` union all (/* select#4 */ select 4 AS `4`,4 AS `4`) insert into t2 values (3,3); insert into t3 values (3,3); (select e,f from t3) intersect all (select c,d from t2) union all (select a,b from t1) union all (select 4,4); @@ -854,14 +675,6 @@ 6 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); -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 -2 INTERSECT t2 ALL NULL NULL NULL NULL 3 100.00 -3 UNION t1 ALL NULL NULL NULL NULL 2 100.00 -4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used -NULL UNIT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 (/* select#1 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`) intersect all (/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) union all (/* select#3 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union all (/* select#4 */ select 4 AS `4`,4 AS `4`) (/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union /* select#3 */ select `__3`.`c` AS `c`,`__3`.`d` AS `d` from ((/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect all (/* select#4 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `__3` union (/* select#5 */ select 4 AS `4`,4 AS `4`); a b 5 5 @@ -1068,14 +881,6 @@ select * from t2 where a < 5 intersect all select * from t3 where a < 5; -id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 Using where -4 UNION ALL NULL NULL NULL NULL 7 100.00 -2 DERIVED t2 ALL NULL NULL NULL NULL 8 100.00 Using where -3 INTERSECT t3 ALL NULL NULL NULL NULL 7 100.00 Using where -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL NULL -Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 union all /* select#4 */ select `__4`.`a` AS `a` from (/* select#2 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where `test`.`t2`.`a` < 5 intersect all /* select#3 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where `test`.`t3`.`a` < 5) `__4` drop table t1,t2,t3; # # MDEV-25158 Segfault on INTERSECT ALL with UNION in Oracle mode @@ -1084,23 +889,8 @@ create table u3 (x int); create table i3 (x int); 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 t3 system NULL NULL NULL NULL 0 Const row not found -4 UNION ALL NULL NULL NULL NULL 2 -2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -3 INTERSECT NULL NULL NULL NULL NULL NULL NULL no matching row in const table -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -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 +1013,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 @@ -1278,22 +1060,7 @@ 1 2 1 2 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 t1 ALL NULL NULL NULL NULL 4 -4 EXCEPT ALL NULL NULL NULL NULL 2 -2 DERIVED t2 ALL NULL NULL NULL NULL 2 -3 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL -NULL EXCEPT RESULT ALL NULL NULL NULL NULL NULL Explain select * from (select * from (select * from t1 except all select * from t2) __3 intersect all values (1,2)) __5; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED ALL NULL NULL NULL NULL 4 -3 DERIVED t1 ALL NULL NULL NULL NULL 4 -4 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 create view v1 as select * from t1 except all select * from t2 intersect all values (1, 2); show create view v1; View Create View character_set_client collation_connection @@ -1313,14 +1080,6 @@ 1 2 drop view v1; explain select * from ((select * from t1 except all select * from t2) intersect all values (1, 2)) v; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -5 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 -4 INTERSECT NULL NULL NULL NULL NULL NULL NULL No tables used -NULL INTERSECT RESULT ALL NULL NULL NULL NULL NULL # Oracle: first UNION, then INTERSECT ALL set sql_mode= 'oracle'; create view v2 as select * from t1 except all select * from t2 intersect all values (1, 2); @@ -1332,14 +1091,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: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.invisible_field [ fail ] Test ended at 2026-04-22 18:33:20 CURRENT_TEST: main.invisible_field --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/invisible_field.result 2026-04-02 14:38:09.381657581 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/invisible_field.reject 2026-04-22 18:33:19.748207958 +0300 @@ -385,14 +385,10 @@ insert into t1(a,b,c) values(32,32,33); insert into t1(a,b,c) values(42,42,43); explain select * from t1 where b=3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const b b 5 const 1 select * from t1 where b=3; a 3 explain select * from t1 where c=3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const c c 5 const 1 select * from t1 where c=3; a 3 @@ -403,9 +399,6 @@ b int(11) YES NULL c int(11) YES NULL explain select * from t1,t2 where t1.b = t2.c and t1.c = t2.b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where -1 SIMPLE t1 eq_ref b,c b 5 test.t2.c 1 Using where select * from t1,t2 where t1.b = t2.c and t1.c = t2.b; a a b c 1 1 1 1 Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.invisible_field/' ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.invisible_field_debug [ fail ] Test ended at 2026-04-22 18:33:23 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-22 18:33:23.051195852 +0300 @@ -345,8 +345,6 @@ 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 alter table t1 add x int default 3; select invisible, a ,b from t1; invisible a b @@ -367,12 +365,8 @@ 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 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 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 ] 50 main.invisible_field_grant_system [ pass ] 15 main.item_types [ pass ] 20 main.join_crash [ pass ] 22 main.json_debug_nonembedded [ pass ] 5 main.json_equals [ pass ] 32 main.json_normalize [ pass ] 21 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test main.key_diff [ fail ] Test ended at 2026-04-22 18:33:40 CURRENT_TEST: main.key_diff --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/key_diff.result 2026-04-02 14:38:09.387657564 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/key_diff.reject 2026-04-22 18:33:40.200866003 +0300 @@ -34,9 +34,6 @@ D E a a a a a a explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 5 -1 SIMPLE t2 ref b b 16 test.t1.a 1 Using index condition select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a; a b a b A B a a Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.key_diff/' main.key_primary [ pass ] 28 main.keywords [ pass ] 196 main.kill_processlist-6619 [ pass ] 13 main.kill_query-6728 [ pass ] 10 main.last_value [ pass ] 6 ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: Query failed on replay server: 1006 Can't create database 'test' (errno: 2 "No such file or directory") ReplayTest: Failed query was: CREATE DATABASE IF NOT EXISTS test ReplayTest: Loading context ReplayTest: optimizer_context returned no rows ReplayTest: Loading context ReplayTest: optimizer_context returned no rows main.limit [ fail ] Test ended at 2026-04-22 18:33:54 CURRENT_TEST: main.limit --- /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/limit.result 2026-04-02 14:38:09.388657562 +0300 +++ /home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/main/limit.reject 2026-04-22 18:33:53.884405770 +0300 @@ -79,14 +79,10 @@ create table t1 (a int); insert into t1 values (1),(2),(3),(4),(5),(6),(7); explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; c 7 explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; c 28 @@ -151,14 +147,10 @@ # EXPLAIN SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected EXPLAIN SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; help_topic_id name help_category_id description example url End of 5.5 tests Result length mismatch - skipping '/home/psergey/dev-git/11.8-skip-records-in-range/mysql-test/var/log/main.limit/' main.loaddata [ pass ] 274 ^CStopping replay server... Replay server stopped psergey@p16heavy:~/dev-git/11.8-skip-records-in-range/mysql-test$