Bug #111891 | Assertion failed in table.h: void Table_ref::set_tableno(uint): Assertion `table | ||
---|---|---|---|
Submitted: | 26 Jul 2023 6:22 | Modified: | 7 Aug 2023 7:57 |
Reporter: | QI XIAODONG | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S6 (Debug Builds) |
Version: | 8.1.0, 8.0.34 | OS: | Linux |
Assigned to: | CPU Architecture: | x86 |
[26 Jul 2023 6:22]
QI XIAODONG
[26 Jul 2023 6:24]
QI XIAODONG
Uploaded mysql-bug-data-111891.zip to Oracle SFTP Server
[26 Jul 2023 9:34]
MySQL Verification Team
Hello QI XIAODONG, Thank you for the report and test case. I tried reproduce on 8.0.34(debug/release) and 8.1.0(debug and release) builds but not seeing any issues. Could you please share the exact cmake options used for the build? Thank you. - bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.1.0 MySQL Community Server - GPL Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.01 sec) [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.1.0]$ bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/mysql-bug-data-111891/init.sql ERROR 1822 (HY000) at line 226: Failed to add the foreign key constraint. Missing index for constraint 'table12_ibfk_1' in the referenced table 'table86' [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.1.0]$ bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/mysql-bug-data-111891/case2.sql [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.1.0]$ - debug bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.1.0-debug MySQL Community Server - GPL - Debug Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.01 sec) [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.1.0]$ bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/mysql-bug-data-111891/init.sql ERROR 1822 (HY000) at line 226: Failed to add the foreign key constraint. Missing index for constraint 'table12_ibfk_1' in the referenced table 'table86' [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.1.0]$ bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/mysql-bug-data-111891/case2.sql regards, Umesh
[7 Aug 2023 3:13]
QI XIAODONG
Sorry, I've attached another case.sql that can replicate the problem
Attachment: case18.sql (application/octet-stream, text), 61.01 KiB.
[7 Aug 2023 7:57]
MySQL Verification Team
Thank you for the feedback. Observed that 8.1.0 debug build is affected. #0 0x00007ff508a2aaa1 in pthread_kill () from /lib64/libpthread.so.0 #1 0x0000000004076b77 in my_write_core(int) () #2 0x000000000330766e in handle_fatal_signal () #3 <signal handler called> #4 0x00007ff506d75387 in raise () from /lib64/libc.so.6 #5 0x00007ff506d76a78 in abort () from /lib64/libc.so.6 #6 0x00007ff506d6e1a6 in __assert_fail_base () from /lib64/libc.so.6 #7 0x00007ff506d6e252 in __assert_fail () from /lib64/libc.so.6 #8 0x0000000003195abc in Table_ref::set_tableno(unsigned int) () #9 0x00000000031ec238 in JOIN::setup_semijoin_materialized_table(JOIN_TAB*, unsigned int, POSITION*, POSITION*) () #10 0x000000000317662d in JOIN::get_best_combination() () #11 0x000000000317f659 in JOIN::make_join_plan() () #12 0x00000000031805d4 in JOIN::optimize(bool) () #13 0x00000000031e6c87 in Query_block::optimize(THD*, bool) () #14 0x000000000325c579 in Query_expression::optimize(THD*, TABLE*, bool, bool) () #15 0x00000000031e68af in Sql_cmd_dml::execute_inner(THD*) () #16 0x00000000031f03d3 in Sql_cmd_dml::execute(THD*) () #17 0x0000000003191136 in mysql_execute_command(THD*, bool) () #18 0x0000000003192579 in dispatch_sql_command(THD*, Parser_state*) () #19 0x0000000003193b7f in dispatch_command(THD*, COM_DATA const*, enum_server_command) () #20 0x0000000003195763 in do_command(THD*) () #21 0x00000000032f967c in handle_connection () #22 0x000000000482e4e4 in pfs_spawn_thread () #23 0x00007ff508a25ea5 in start_thread () from /lib64/libpthread.so.0 #24 0x00007ff506e3db2d in clone () from /lib64/libc.so.6 (gdb) quit
[7 Aug 2023 8:41]
MySQL Verification Team
- 8.0.34 debug build affected as well [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.0.34]$ bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.34-debug MySQL Community Server - GPL - Debug Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.00 sec) mysql> use test Database changed mysql> \q Bye [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.0.34]$ bin/mysql -uroot -S /tmp/mysql.sock test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.34-debug MySQL Community Server - GPL - Debug Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set sql_mode=''; Query OK, 0 rows affected (0.00 sec) bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/mysql-bug-data-111891/init.sql ERROR 1822 (HY000) at line 226: Failed to add the foreign key constraint. Missing index for constraint 'table12_ibfk_1' in the referenced table 'table86' [umshastr@support-cluster03:/export/home/tmp/ushastry/mysql-8.0.34]$ bin/mysql -uroot -S /tmp/mysql.sock test < ../mysql-8.0.34/case18.sql ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query gdb) bt #0 0x00007ff338eb0aa1 in pthread_kill () from /lib64/libpthread.so.0 #1 0x000000000402c28e in my_write_core(int) () #2 0x00000000032d235e in handle_fatal_signal () #3 <signal handler called> #4 0x00007ff3371fb387 in raise () from /lib64/libc.so.6 #5 0x00007ff3371fca78 in abort () from /lib64/libc.so.6 #6 0x00007ff3371f41a6 in __assert_fail_base () from /lib64/libc.so.6 #7 0x00007ff3371f4252 in __assert_fail () from /lib64/libc.so.6 #8 0x0000000003165cc4 in Table_ref::set_tableno(unsigned int) () #9 0x00000000031bcad4 in JOIN::setup_semijoin_materialized_table(JOIN_TAB*, unsigned int, POSITION*, POSITION*) () #10 0x0000000003146961 in JOIN::get_best_combination() () #11 0x000000000314f97d in JOIN::make_join_plan() () #12 0x00000000031508c8 in JOIN::optimize(bool) () #13 0x00000000031b755f in Query_block::optimize(THD*, bool) () #14 0x000000000322d695 in Query_expression::optimize(THD*, TABLE*, bool, bool) () #15 0x00000000031b7187 in Sql_cmd_dml::execute_inner(THD*) () #16 0x00000000031c0beb in Sql_cmd_dml::execute(THD*) () #17 0x0000000003161263 in mysql_execute_command(THD*, bool) () #18 0x00000000031626a2 in dispatch_sql_command(THD*, Parser_state*) () #19 0x0000000003163cd5 in dispatch_command(THD*, COM_DATA const*, enum_server_command) () #20 0x000000000316596c in do_command(THD*) () #21 0x00000000032c437c in handle_connection () #22 0x00000000047e1af5 in pfs_spawn_thread () #23 0x00007ff338eabea5 in start_thread () from /lib64/libpthread.so.0 #24 0x00007ff3372c3b2d in clone () from /lib64/libc.so.6 (gdb)