Bug #111306 | AccessPath* MoveCompositeIteratorsFromTablePath(AccessPath*, const Query_block& | ||
---|---|---|---|
Submitted: | 6 Jun 2023 22:04 | Modified: | 1 Mar 2024 17:49 |
Reporter: | Yu Liang | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S6 (Debug Builds) |
Version: | 8.0.33 | OS: | Ubuntu (20.04 LTS) |
Assigned to: | CPU Architecture: | x86 (Intel(R) Core(TM) i7-10700) |
[6 Jun 2023 22:04]
Yu Liang
[7 Jun 2023 5:27]
MySQL Verification Team
Hello Yu Liang, Thank you for the report and test case. Observed that 8.0.33 only debug build is affected. regards, Umesh
[7 Jun 2023 5:32]
MySQL Verification Team
- 8.0.33 release build - not affected ./mtr bug111306 --nocheck-testcases Logging: ./mtr bug111306 --nocheck-testcases MySQL Version 8.0.33 Checking supported features Using 'all' suites Collecting tests Checking leftover processes Removing old var directory - WARNING: Using the 'mysql-test/var' symlink Creating var directory '/export/home/tmp/ushastry/mysql-8.0.33/mysql-test/var' Installing system database Using parallel: 1 ============================================================================== TEST NAME RESULT TIME (ms) COMMENT ------------------------------------------------------------------------------ drop database if exists test123; Warnings: Note 1008 Can't drop database 'test123'; database doesn't exist create database test123; use test123; CREATE TABLE v0 ( c1 INT); ( TABLE v0 LIMIT 100 ) ORDER BY c1 MEMBER OF ( c1 ) < c1 MEMBER ( ROW_NUMBER ( ) OVER ( ) ) ; c1 [ 50%] main.bug111306 [ pass ] 7 [100%] shutdown_report [ pass ] ------------------------------------------------------------------------------ The servers were restarted 0 times The servers were reinitialized 0 times Spent 0.007 of 6 seconds executing testcases - 8.0.33 release build - not affected ./mtr bug111306 --nocheck-testcases --debug-server Logging: ./mtr bug111306 --nocheck-testcases --debug-server MySQL Version 8.0.33 Checking supported features - Binaries are debug compiled Using 'all' suites Collecting tests Checking leftover processes Removing old var directory - WARNING: Using the 'mysql-test/var' symlink Creating var directory '/export/home/tmp/ushastry/mysql-8.0.33/mysql-test/var' Installing system database Using parallel: 1 ============================================================================== TEST NAME RESULT TIME (ms) COMMENT ------------------------------------------------------------------------------ drop database if exists test123; Warnings: Note 1008 Can't drop database 'test123'; database doesn't exist create database test123; use test123; CREATE TABLE v0 ( c1 INT); ( TABLE v0 LIMIT 100 ) ORDER BY c1 MEMBER OF ( c1 ) < c1 MEMBER ( ROW_NUMBER ( ) OVER ( ) ) ; [ 50%] main.bug111306 [ fail ] Test ended at 2023-06-07 07:26:27 CURRENT_TEST: main.bug111306 mysqltest: At line 5: Query '( TABLE v0 LIMIT 100 ) ORDER BY c1 MEMBER OF ( c1 ) < c1 MEMBER ( ROW_NUMBER ( ) OVER ( ) ) ' failed. ERROR 2013 (HY000): Lost connection to MySQL server during query . #0 0x00007f071938faa1 in pthread_kill () from /lib64/libpthread.so.0 #1 0x0000000003f9296e in my_write_core(int) () #2 0x00000000032365f5 in handle_fatal_signal () #3 <signal handler called> #4 0x00007f07175c9387 in raise () from /lib64/libc.so.6 #5 0x00007f07175caa78 in abort () from /lib64/libc.so.6 #6 0x00007f07175c21a6 in __assert_fail_base () from /lib64/libc.so.6 #7 0x00007f07175c2252 in __assert_fail () from /lib64/libc.so.6 #8 0x0000000003079cd2 in MoveCompositeIteratorsFromTablePath(AccessPath*, Query_block const&) () #9 0x000000000318dd17 in add_materialized_access_path(THD*, Query_term*, Mem_root_array<MaterializePathParameters::QueryBlock>&, TABLE*, unsigned long long) () #10 0x000000000319004b in make_set_op_access_path(THD*, Query_term_set_op*, Query_term*, Mem_root_array<AppendPathParameters>*, bool) [clone .localalias.3] () #11 0x000000000318ff72 in make_set_op_access_path(THD*, Query_term_set_op*, Query_term*, Mem_root_array<AppendPathParameters>*, bool) [clone .localalias.3] () #12 0x000000000319043e in Query_expression::create_access_paths(THD*) () #13 0x0000000003191299 in Query_expression::optimize(THD*, TABLE*, bool, bool) () #14 0x000000000311a0d5 in Sql_cmd_dml::execute_inner(THD*) () #15 0x0000000003123873 in Sql_cmd_dml::execute(THD*) () #16 0x00000000030c4964 in mysql_execute_command(THD*, bool) () #17 0x00000000030c5dc9 in dispatch_sql_command(THD*, Parser_state*) () #18 0x00000000030c752b in dispatch_command(THD*, COM_DATA const*, enum_server_command) () #19 0x00000000030c926e in do_command(THD*) () #20 0x0000000003227bb7 in handle_connection () #21 0x0000000004743af9 in pfs_spawn_thread () #22 0x00007f071938aea5 in start_thread () from /lib64/libpthread.so.0 #23 0x00007f0717691b2d in clone () from /lib64/libc.so.6
[27 Jun 2023 8:14]
Pedro Ferreira
I was able to reproduce this today with: CREATE TABLE t0 (c0 INT); CREATE VIEW v0 (c0, c1) AS ((SELECT 1,2 FROM t0) INTERSECT (SELECT 1,2)); SELECT 1 FROM v0 JOIN t0 ON t0.c0 = v0.c1 WHERE (t0.c0 + t0.c0) > v0.c0;
[1 Mar 2024 17:49]
Jon Stephens
Documented fix as follows in the MySQL 8.0.36 and 8.3.0 changelogs: Ordering a nested block where the ORDER BY contained a window function raised an assert in sql/sql_executor.cc. Closed.