|
I do not think that it is a good idea to remove the failing debug assertions. Instead, this should be fixed in the SQL layer.
We should not allow a DDL statement in the middle of a XA transaction, because currently, DDL statements cannot be rolled back.
The debug assertions fail because an existing DML transaction is being partly overwritten with a DDL transaction:
|
10.9 b9c7da4c91919b188ea04c528bef5fbf8f9222e6
|
#0 0x00005574e93d1db9 in innobase_trx_init (thd=thd@entry=0x7f8480002108, trx=0x7f84ab951b80) at /mariadb/10.9/storage/innobase/handler/ha_innodb.cc:2833
|
#1 0x00005574e93e0dab in check_trx_exists (thd=0x7f8480002108) at /mariadb/10.9/storage/innobase/handler/ha_innodb.cc:2878
|
#2 create_table_info_t::initialize (this=this@entry=0x7f84a00a6d28) at /mariadb/10.9/storage/innobase/handler/ha_innodb.cc:12063
|
#3 0x00005574e93e4229 in ha_innobase::create (this=0x7f84801f2360, name=0x7f84a00a8670 "/dev/shm/10.9/mysql-test/var/tmp/mysqld.1/#sql-temptable-1ebd0-4-19", form=0x7f84a00a7a58, create_info=0x7f84a00a8b58, file_per_table=true, trx=0x0) at /mariadb/10.9/storage/innobase/handler/ha_innodb.cc:13236
|
#4 0x00005574e8e00e3d in handler::ha_create (this=0x7f84801f2b90, name=0x7f84a00a8670 "/dev/shm/10.9/mysql-test/var/tmp/mysqld.1/#sql-temptable-1ebd0-4-19", form=form@entry=0x7f84a00a7a58, info_arg=info_arg@entry=0x7f84a00a8b58) at /mariadb/10.9/sql/handler.cc:5506
|
#5 0x00005574e8e021cd in ha_create_table (thd=thd@entry=0x7f8480002108, path=<optimized out>, db=0x7f848002eb98 "test", table_name=0x7f848002e428 "s1", create_info=create_info@entry=0x7f84a00a8b58, frm=0x7f84a00a8640, skip_frm_file=<optimized out>) at /mariadb/10.9/sql/handler.cc:5975
|
#6 0x00005574e919a040 in create_table_impl (thd=thd@entry=0x7f8480002108, ddl_log_state_create=0x0, ddl_log_state_rm=<optimized out>, orig_db=<optimized out>, orig_table_name=<optimized out>, db=<optimized out>, table_name=<optimized out>, path=<optimized out>, options=<optimized out>, create_info=<optimized out>, alter_info=<optimized out>, create_table_mode=<optimized out>, is_trans=<optimized out>, key_info=<optimized out>, key_count=<optimized out>,
|
frm=<optimized out>) at /mariadb/10.9/sql/sql_table.cc:4669
|
#7 0x00005574e9199499 in mysql_create_table_no_lock (thd=<optimized out>, thd@entry=0x7f8480002108, ddl_log_state_create=<optimized out>, ddl_log_state_rm=<optimized out>, db=db@entry=0x7f848002e4a0, table_name=0x1, table_name@entry=0x7f848002e4b0, create_info=create_info@entry=0x7f84a00a8b58, alter_info=<optimized out>, is_trans=<optimized out>, create_table_mode=<optimized out>, table_list=<optimized out>) at /mariadb/10.9/sql/sql_table.cc:4770
|
#8 0x00005574e91aa6db in mysql_create_table (thd=thd@entry=0x7f8480002108, create_table=<optimized out>, create_table@entry=0x7f848002e488, create_info=create_info@entry=0x7f84a00a8b58, alter_info=<optimized out>, alter_info@entry=0x7f84a00a8a70) at /mariadb/10.9/sql/sql_table.cc:4886
|
#9 0x00005574e91a9485 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x7f8480002108) at /mariadb/10.9/sql/sql_table.cc:12492
|
#10 0x00005574e90cc0d9 in mysql_execute_command (thd=thd@entry=0x7f8480002108, is_called_from_prepared_stmt=false) at /mariadb/10.9/sql/sql_parse.cc:6014
|
#11 0x00005574e90c762e in mysql_parse (thd=thd@entry=0x7f8480002108, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f84a00a93a0) at /mariadb/10.9/sql/sql_parse.cc:8048
|
#12 0x00005574e90c5bde in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f8480002108, packet=packet@entry=0x7f8480024839 "CREATE TEMPORARY SEQUENCE s1 engine=innodb", packet_length=packet_length@entry=42, blocking=true) at /mariadb/10.9/sql/sql_parse.cc:1894
|
The assertion will fail when the CREATE TEMPORARY SEQUENCE statement is being committed (which would wrongly commit the XA transaction as well):
|
10.9 b9c7da4c91919b188ea04c528bef5fbf8f9222e6
|
#0 __assert_fail (assertion=0x5574e87fe3d1 "!check_unique_secondary", file=0x5574e87e2da1 "/mariadb/10.9/storage/innobase/include/trx0trx.h", line=1164, function=0x5574e8706496 "trx_mod_table_time_t *trx_t::check_bulk_buffer(dict_table_t *)") at ./assert/assert.c:101
|
#1 0x00005574e965d861 in trx_t::check_bulk_buffer (this=this@entry=0x7f84ab951b80, table=0x7f84802323d0) at /mariadb/10.9/storage/innobase/include/trx0trx.h:1164
|
#2 0x00005574e965981f in row_ins_index_entry (index=0x7f848022fdc0, entry=0x7f848006f4e0, thr=0x7f84801dd3d8) at /mariadb/10.9/storage/innobase/row/row0ins.cc:3388
|
#3 row_ins_index_entry_step (node=0x7f84801dd0e0, thr=0x7f84801dd3d8) at /mariadb/10.9/storage/innobase/row/row0ins.cc:3565
|
#4 row_ins (node=0x7f84801dd0e0, thr=0x7f84801dd3d8) at /mariadb/10.9/storage/innobase/row/row0ins.cc:3690
|
#5 row_ins_step (thr=thr@entry=0x7f84801dd3d8) at /mariadb/10.9/storage/innobase/row/row0ins.cc:3819
|
#6 0x00005574e9677700 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x7f84801f2588 "\377\001", prebuilt=0x7f84801dcad0, ins_mode=ROW_INS_NORMAL) at /mariadb/10.9/storage/innobase/row/row0mysql.cc:1314
|
#7 0x00005574e93d846a in ha_innobase::write_row (this=0x7f84801f29a0, record=0x7f84801f2588 "\377\001") at /mariadb/10.9/storage/innobase/handler/ha_innodb.cc:7871
|
#8 0x00005574e8e05b10 in handler::ha_write_row (this=0x7f84801db8c0, buf=0x7f84801f2588 "\377\001") at /mariadb/10.9/sql/handler.cc:7631
|
#9 0x00005574e92e91ab in sequence_definition::write_initial_sequence (this=<optimized out>, table=0x7f84801b86b8) at /mariadb/10.9/sql/sql_sequence.cc:625
|
#10 sequence_insert (thd=thd@entry=0x7f8480002108, lex=0x7f8480006290, org_table_list=org_table_list@entry=0x7f848002e488) at /mariadb/10.9/sql/sql_sequence.cc:375
|
#11 0x00005574e9199520 in mysql_create_table_no_lock (thd=thd@entry=0x7f8480002108, ddl_log_state_create=0x7f84a00a8940, ddl_log_state_rm=0x7f84a00a8920, db=db@entry=0x7f848002e4a0, table_name=table_name@entry=0x7f848002e4b0, create_info=create_info@entry=0x7f84a00a8b58, alter_info=<optimized out>, is_trans=<optimized out>, create_table_mode=<optimized out>, table_list=<optimized out>) at /mariadb/10.9/sql/sql_table.cc:4784
|
#12 0x00005574e91aa6db in mysql_create_table (thd=thd@entry=0x7f8480002108, create_table=<optimized out>, create_table@entry=0x7f848002e488, create_info=create_info@entry=0x7f84a00a8b58, alter_info=<optimized out>, alter_info@entry=0x7f84a00a8a70) at /mariadb/10.9/sql/sql_table.cc:4886
|
#13 0x00005574e91a9485 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x7f8480002108) at /mariadb/10.9/sql/sql_table.cc:12492
|
#14 0x00005574e90cc0d9 in mysql_execute_command (thd=thd@entry=0x7f8480002108, is_called_from_prepared_stmt=false) at /mariadb/10.9/sql/sql_parse.cc:6014
|
#15 0x00005574e90c762e in mysql_parse (thd=thd@entry=0x7f8480002108, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f84a00a93a0) at /mariadb/10.9/sql/sql_parse.cc:8048
|
#16 0x00005574e90c5bde in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f8480002108, packet=packet@entry=0x7f8480024839 "CREATE TEMPORARY SEQUENCE s1 engine=innodb", packet_length=packet_length@entry=42, blocking=true) at /mariadb/10.9/sql/sql_parse.cc:1894
|
|
|
Additional testcase, debug only:
--source include/have_innodb.inc
|
SET @old_unique_checks=1,unique_checks=0;
|
CREATE TABLE t (c1 INT) ENGINE=InnoDB;
|
XA START 'a';
|
SET foreign_key_checks=0;
|
INSERT INTO t VALUES (1);
|
SET foreign_key_checks=1;
|
CREATE TEMPORARY SEQUENCE f ENGINE=InnoDB;
|
Leads to the same stack (on debug, build 31/10):
|
11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug)
|
mariadbd: /test/11.3_dbg/storage/innobase/include/trx0trx.h:1173: trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*): Assertion `!check_foreigns' failed.
|
|
11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug)
|
Core was generated by `/test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23078538393152)
|
at ./nptl/pthread_kill.c:44
|
[Current thread is 1 (Thread 0x14fd64153640 (LWP 630228))]
|
(gdb) bt
|
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23078538393152) at ./nptl/pthread_kill.c:44
|
#1 __pthread_kill_internal (signo=6, threadid=23078538393152) at ./nptl/pthread_kill.c:78
|
#2 __GI___pthread_kill (threadid=23078538393152, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
|
#3 0x000014fd7ac42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
|
#4 0x000014fd7ac287f3 in __GI_abort () at ./stdlib/abort.c:79
|
#5 0x000014fd7ac2871b in __assert_fail_base (fmt=0x14fd7addd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c87207216c "!check_foreigns", file=0x55c87203b3e0 "/test/11.3_dbg/storage/innobase/include/trx0trx.h", line=1173, function=<optimized out>) at ./assert/assert.c:92
|
#6 0x000014fd7ac39e96 in __GI___assert_fail (assertion=0x55c87207216c "!check_foreigns", file=0x55c87203b3e0 "/test/11.3_dbg/storage/innobase/include/trx0trx.h", line=1173, function=0x55c872073ce8 "trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*)") at ./assert/assert.c:101
|
#7 0x000055c871992226 in trx_t::check_bulk_buffer (table=0x14fd3038bfb8, this=0x14fd65954b80) at /test/11.3_dbg/storage/innobase/include/trx0trx.h:1173
|
#8 row_ins_index_entry (thr=0x14fd3038f280, entry=0x14fd30021ef8, index=0x14fd3038cc38) at /test/11.3_dbg/storage/innobase/row/row0ins.cc:3366
|
#9 row_ins_index_entry_step (thr=0x14fd3038f280, node=0x14fd3038ef88) at /test/11.3_dbg/storage/innobase/row/row0ins.cc:3543
|
#10 row_ins (thr=0x14fd3038f280, node=0x14fd3038ef88) at /test/11.3_dbg/storage/innobase/row/row0ins.cc:3660
|
#11 row_ins_step (thr=thr@entry=0x14fd3038f280) at /test/11.3_dbg/storage/innobase/row/row0ins.cc:3789
|
#12 0x000055c8719b4d68 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14fd3038b438 "\377\001", prebuilt=0x14fd3038e998, ins_mode=ins_mode@entry=ROW_INS_NORMAL) at /test/11.3_dbg/storage/innobase/row/row0mysql.cc:1314
|
#13 0x000055c8718666e6 in ha_innobase::write_row (this=0x14fd3038d4a0, record=0x14fd3038b438 "\377\001") at /test/11.3_dbg/storage/innobase/handler/ha_innodb.cc:7839
|
#14 0x000055c8717fe242 in ha_sequence::write_row (this=0x14fd3038b850, buf=0x14fd3038b438 "\377\001") at /test/11.3_dbg/sql/ha_sequence.cc:223
|
#15 0x000055c8715004b9 in handler::ha_write_row (this=0x14fd3038b850, buf=0x14fd3038b438 "\377\001") at /test/11.3_dbg/sql/handler.cc:7863
|
#16 0x000055c871444228 in sequence_definition::write_initial_sequence (this=this@entry=0x14fd30013d10, table=0x14fd3038b028) at /test/11.3_dbg/sql/sql_sequence.cc:620
|
#17 0x000055c871444413 in sequence_insert (thd=thd@entry=0x14fd30000d58, lex=0x14fd300050e0, org_table_list=org_table_list@entry=0x14fd300135f8) at /test/11.3_dbg/sql/sql_sequence.cc:370
|
#18 0x000055c8712d3de9 in mysql_create_table_no_lock (thd=thd@entry=0x14fd30000d58, ddl_log_state_create=ddl_log_state_create@entry=0x14fd6414fe00, ddl_log_state_rm=ddl_log_state_rm@entry=0x14fd64150010, create_info=create_info@entry=0x14fd64150180, alter_info=alter_info@entry=0x14fd6414fea0, is_trans=is_trans@entry=0x14fd6414fde0, create_table_mode=0, table_list=0x14fd300135f8) at /test/11.3_dbg/sql/sql_table.cc:4727
|
#19 0x000055c8712d5d73 in mysql_create_table (alter_info=0x14fd6414fea0, create_info=0x14fd64150180, create_table=0x14fd300135f8, thd=0x14fd30000d58) at /test/11.3_dbg/sql/sql_table.cc:4883
|
#20 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14fd30000d58) at /test/11.3_dbg/sql/sql_table.cc:12903
|
#21 0x000055c8711efe32 in mysql_execute_command (thd=thd@entry=0x14fd30000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.3_dbg/sql/sql_parse.cc:5734
|
#22 0x000055c8711f1193 in mysql_parse (thd=thd@entry=0x14fd30000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14fd641521e0) at /test/11.3_dbg/sql/sql_parse.cc:7742
|
#23 0x000055c8711f3509 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14fd30000d58, packet=packet@entry=0x14fd3000b1b9 "CREATE TEMPORARY SEQUENCE f", packet_length=packet_length@entry=27, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_class.h:251
|
#24 0x000055c8711f5625 in do_command (thd=0x14fd30000d58, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:1406
|
#25 0x000055c87135a54d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c874385828, put_in_cache=put_in_cache@entry=true) at /test/11.3_dbg/sql/sql_connect.cc:1418
|
#26 0x000055c87135a842 in handle_one_connection (arg=arg@entry=0x55c874385828) at /test/11.3_dbg/sql/sql_connect.cc:1320
|
#27 0x000055c87179fa28 in pfs_spawn_thread (arg=0x55c8743dd168) at /test/11.3_dbg/storage/perfschema/pfs.cc:2201
|
#28 0x000014fd7ac94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#29 0x000014fd7ad26a40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
Bug confirmed present in 10.9 to 11.4 (dbg)
|