Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
The assertion looks like MDEV-19273, but the rest – the location, scenario, affected versions – are completely different.
SET sql_mode= 'STRICT_TRANS_TABLES'; # Only needed for 10.1, in higher versions it is default |
|
CREATE TABLE t1 (a INT); |
LOCK TABLE t1 WRITE; |
|
--error ER_DATA_TOO_LONG
|
CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a; |
|
# Cleanup
|
DROP TABLE t1; |
10.2 release 5f1ec5cb |
#3 <signal handler called>
|
#4 close_thread_table (thd=thd@entry=0x7fa8d80009a8, table_ptr=table_ptr@entry=0x7fa8d8000a88) at /data/src/10.2/sql/sql_base.cc:886
|
#5 0x0000560bb5d11e6c in drop_open_table (thd=0x7fa8d80009a8, table=<optimized out>, db_name=0x7fa8d800f808 "test", table_name=0x7fa8d800f1a0 "t1") at /data/src/10.2/sql/sql_base.cc:1272
|
#6 0x0000560bb5d3d7ce in select_create::abort_result_set (this=0x7fa8d800faa0) at /data/src/10.2/sql/sql_insert.cc:4721
|
#7 0x0000560bb5db2e5a in handle_select (thd=thd@entry=0x7fa8d80009a8, lex=lex@entry=0x7fa8d8004320, result=result@entry=0x7fa8d800faa0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.2/sql/sql_select.cc:379
|
#8 0x0000560bb5de6ed3 in Sql_cmd_create_table::execute (this=<optimized out>, thd=0x7fa8d80009a8) at /data/src/10.2/sql/sql_table.cc:10943
|
#9 0x0000560bb5d5c44a in mysql_execute_command (thd=thd@entry=0x7fa8d80009a8) at /data/src/10.2/sql/sql_parse.cc:5964
|
#10 0x0000560bb5d6370e in mysql_parse (thd=thd@entry=0x7fa8d80009a8, rawbuf=<optimized out>, length=59, parser_state=parser_state@entry=0x7fa92c93d620, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:7733
|
#11 0x0000560bb5d65fa0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fa8d80009a8, packet=packet@entry=0x7fa8d8006d09 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", packet_length=packet_length@entry=59, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1824
|
#12 0x0000560bb5d66d60 in do_command (thd=0x7fa8d80009a8) at /data/src/10.2/sql/sql_parse.cc:1377
|
#13 0x0000560bb5e33682 in do_handle_one_connection (connect=connect@entry=0x560bb8d97d88) at /data/src/10.2/sql/sql_connect.cc:1336
|
#14 0x0000560bb5e337dd in handle_one_connection (arg=arg@entry=0x560bb8d97d88) at /data/src/10.2/sql/sql_connect.cc:1241
|
#15 0x0000560bb63f4f01 in pfs_spawn_thread (arg=0x560bb8d97fe8) at /data/src/10.2/storage/perfschema/pfs.cc:1869
|
#16 0x00007fa9335124a4 in start_thread (arg=0x7fa92c93e700) at pthread_create.c:456
|
#17 0x00007fa932590d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
10.2 debug 6e09e7c1 |
mysqld: /data/src/10.2/sql/sql_base.cc:883: void close_thread_table(THD*, TABLE**): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)' failed.
|
200803 21:45:23 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007fdc12548f12 in __GI___assert_fail (assertion=0x555b6fc8db78 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)", file=0x555b6fc8d830 "/data/src/10.2/sql/sql_base.cc", line=883, function=0x555b6fc8f3a0 <close_thread_table(THD*, TABLE**)::__PRETTY_FUNCTION__> "void close_thread_table(THD*, TABLE**)") at assert.c:101
|
#8 0x0000555b6f1a62e6 in close_thread_table (thd=0x7fdbfc000af0, table_ptr=0x7fdbfc000bd0) at /data/src/10.2/sql/sql_base.cc:880
|
#9 0x0000555b6f1a6150 in close_thread_tables (thd=0x7fdbfc000af0) at /data/src/10.2/sql/sql_base.cc:859
|
#10 0x0000555b6f1a8c2f in Locked_tables_list::unlock_locked_tables (this=0x7fdbfc004558, thd=0x7fdbfc000af0) at /data/src/10.2/sql/sql_base.cc:2219
|
#11 0x0000555b6f1a8ca9 in Locked_tables_list::unlock_locked_table (this=0x7fdbfc004558, thd=0x7fdbfc000af0, mdl_ticket=0x7fdbfc010d70) at /data/src/10.2/sql/sql_base.cc:2261
|
#12 0x0000555b6f1ff49a in select_create::abort_result_set (this=0x7fdbfc012e48) at /data/src/10.2/sql/sql_insert.cc:4694
|
#13 0x0000555b6f257b24 in handle_select (thd=0x7fdbfc000af0, lex=0x7fdbfc004628, result=0x7fdbfc012e48, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:379
|
#14 0x0000555b6f2f6edd in Sql_cmd_create_table::execute (this=0x7fdbfc012578, thd=0x7fdbfc000af0) at /data/src/10.2/sql/sql_table.cc:10944
|
#15 0x0000555b6f2222a2 in mysql_execute_command (thd=0x7fdbfc000af0) at /data/src/10.2/sql/sql_parse.cc:5964
|
#16 0x0000555b6f227223 in mysql_parse (thd=0x7fdbfc000af0, rawbuf=0x7fdbfc012458 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", length=59, parser_state=0x7fdc0c87c610, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7733
|
#17 0x0000555b6f21554f in dispatch_command (command=COM_QUERY, thd=0x7fdbfc000af0, packet=0x7fdbfc08d321 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", packet_length=59, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
|
#18 0x0000555b6f213fca in do_command (thd=0x7fdbfc000af0) at /data/src/10.2/sql/sql_parse.cc:1377
|
#19 0x0000555b6f36a099 in do_handle_one_connection (connect=0x555b72996cf0) at /data/src/10.2/sql/sql_connect.cc:1336
|
#20 0x0000555b6f369e04 in handle_one_connection (arg=0x555b72996cf0) at /data/src/10.2/sql/sql_connect.cc:1241
|
#21 0x0000555b6fb80aa8 in pfs_spawn_thread (arg=0x555b729a1ae0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
|
#22 0x00007fdc144d14a4 in start_thread (arg=0x7fdc0c87d700) at pthread_create.c:456
|
#23 0x00007fdc12605d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible on 10.1-10.5 with at least MyISAM, InnoDB, Aria, on debug and non-debug builds as described
A slightly different test case causes a slightly different stack trace on debug builds. On 10.2-10.4 it's still very similar to the above, just shorter, while on 10.5 it happens in a different function.
--error ER_DATA_TOO_LONG
# Cleanup
UNLOCK TABLES;
10.2 debug 80075ba0
mysqld: /data/src/10.2/sql/sql_base.cc:880: void close_thread_table(THD*, TABLE**): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)' failed.
200916 0:23:53 [ERROR] mysqld got signal 6 ;
#7 0x00007f680ea9ff36 in __GI___assert_fail (assertion=0x55898a86bc30 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)", file=0x55898a86b798 "/data/src/10.2/sql/sql_base.cc", line=880, function=0x55898a86bbb0 "void close_thread_table(THD*, TABLE**)") at assert.c:101
#8 0x0000558989d391af in close_thread_table (thd=0x7f67f8000d90, table_ptr=0x7f67f8000e70) at /data/src/10.2/sql/sql_base.cc:880
#9 0x0000558989d39def in drop_open_table (thd=0x7f67f8000d90, table=0x7f67f80a04a0, db_name=0x7f67f8012e50 "test", table_name=0x7f67f80127e8 "t1") at /data/src/10.2/sql/sql_base.cc:1272
#10 0x0000558989d93857 in select_create::abort_result_set (this=0x7f67f80130e8) at /data/src/10.2/sql/sql_insert.cc:4719
#11 0x0000558989decf48 in handle_select (thd=0x7f67f8000d90, lex=0x7f67f80048c8, result=0x7f67f80130e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:379
#12 0x0000558989e8db19 in Sql_cmd_create_table::execute (this=0x7f67f8012818, thd=0x7f67f8000d90) at /data/src/10.2/sql/sql_table.cc:10944
#13 0x0000558989db6a41 in mysql_execute_command (thd=0x7f67f8000d90) at /data/src/10.2/sql/sql_parse.cc:5964
#14 0x0000558989dbba57 in mysql_parse (thd=0x7f67f8000d90, rawbuf=0x7f67f80126f8 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", length=59, parser_state=0x7f6808bfa5f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7733
#15 0x0000558989da9d66 in dispatch_command (command=COM_QUERY, thd=0x7f67f8000d90, packet=0x7f67f8008b51 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", packet_length=59, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1823
#16 0x0000558989da8861 in do_command (thd=0x7f67f8000d90) at /data/src/10.2/sql/sql_parse.cc:1377
#17 0x0000558989f02233 in do_handle_one_connection (connect=0x55898c383aa0) at /data/src/10.2/sql/sql_connect.cc:1336
#18 0x0000558989f01f98 in handle_one_connection (arg=0x55898c383aa0) at /data/src/10.2/sql/sql_connect.cc:1241
#19 0x000055898a726514 in pfs_spawn_thread (arg=0x55898c38c770) at /data/src/10.2/storage/perfschema/pfs.cc:1869
#20 0x00007f680efb1609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x00007f680eb8b103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
10.5 debug 2bac9782
mariadbd: /data/src/10.5/sql/table_cache.cc:1253: void TDC_element::flush(THD*, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)' failed.
200916 0:26:19 [ERROR] mysqld got signal 6 ;
#7 0x00007f6dbf767f36 in __GI___assert_fail (assertion=0x5625d608a3a8 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)", file=0x5625d6089bb0 "/data/src/10.5/sql/table_cache.cc", line=1253, function=0x5625d608a548 "void TDC_element::flush(THD*, bool)") at assert.c:101
#8 0x00005625d53ef013 in TDC_element::flush (this=0x7f6da805c258, thd=0x7f6da8000db8, mark_flushed=true) at /data/src/10.5/sql/table_cache.cc:1253
#9 0x00005625d50af7ce in drop_open_table (thd=0x7f6da8000db8, table=0x7f6da80436a8, db_name=0x7f6da8014078, table_name=0x7f6da8014088) at /data/src/10.5/sql/sql_base.cc:1355
#10 0x00005625d5119702 in select_create::abort_result_set (this=0x7f6da80156c8) at /data/src/10.5/sql/sql_insert.cc:5092
#11 0x00005625d51a3ad9 in handle_select (thd=0x7f6da8000db8, lex=0x7f6da8004e88, result=0x7f6da80156c8, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:435
#12 0x00005625d526a5ac in Sql_cmd_create_table_like::execute (this=0x7f6da8014000, thd=0x7f6da8000db8) at /data/src/10.5/sql/sql_table.cc:11964
#13 0x00005625d51659be in mysql_execute_command (thd=0x7f6da8000db8) at /data/src/10.5/sql/sql_parse.cc:5952
#14 0x00005625d516bdd2 in mysql_parse (thd=0x7f6da8000db8, rawbuf=0x7f6da8013f20 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", length=59, parser_state=0x7f6dba124510, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7994
#15 0x00005625d5158110 in dispatch_command (command=COM_QUERY, thd=0x7f6da8000db8, packet=0x7f6da8009099 "CREATE OR REPLACE TABLE t1 (a CHAR(1)) AS SELECT 'foo' AS a", packet_length=59, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1867
#16 0x00005625d5156904 in do_command (thd=0x7f6da8000db8) at /data/src/10.5/sql/sql_parse.cc:1348
#17 0x00005625d53026dc in do_handle_one_connection (connect=0x5625d85a2f68, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1410
#18 0x00005625d5302444 in handle_one_connection (arg=0x5625d8657d28) at /data/src/10.5/sql/sql_connect.cc:1312
#19 0x00005625d585cf15 in pfs_spawn_thread (arg=0x5625d85a2ba8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
#20 0x00007f6dbfc7f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x00007f6dbf853103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95