Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31298

Assertion `!check_foreigns' failed in trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*), Assertion `table->skip_alter_undo || !check_unique_secondary' failed in trx_t::check_bulk_buffer

Details

    Description

      --source include/have_innodb.inc
      SET foreign_key_checks=0,unique_checks=0;
      CREATE TABLE t1 (c1 CHAR,INDEX (c1)) ENGINE=INNODB;
      XA START 'a';
      INSERT INTO t1 VALUES();
      SET foreign_key_checks=1;
      CREATE TEMPORARY SEQUENCE f;
      

      Leads to:

      11.0.2 368dd22a816f3b437bccd0b9ff28b9de9b1abf0a (Debug)

      mariadbd: /test/mtest/11.0_dbg/storage/innobase/include/trx0trx.h:1162: trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*): Assertion `!check_foreigns' failed.
      

      11.0.2 368dd22a816f3b437bccd0b9ff28b9de9b1abf0a (Debug)

      Core was generated by `/test/mtest/GAL_MD170523-mariadb-11.0.2-linux-x86_64-dbg/bin/mariadbd --no-defa'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x145cfca26700 (LWP 415274))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055c91dbb0747 in my_write_core (sig=sig@entry=6) at /test/mtest/11.0_dbg/mysys/stacktrace.c:424
      #2  0x000055c91d49e460 in handle_fatal_signal (sig=6) at /test/mtest/11.0_dbg/sql/signal_handler.cc:360
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000145d157a8859 in __GI_abort () at abort.c:79
      #6  0x0000145d157a8729 in __assert_fail_base (fmt=0x145d1593e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c91dfb7d34 "!check_foreigns", file=0x55c91df83be0 "/test/mtest/11.0_dbg/storage/innobase/include/trx0trx.h", line=1162, function=<optimized out>) at assert.c:92
      #7  0x0000145d157b9fd6 in __GI___assert_fail (assertion=assertion@entry=0x55c91dfb7d34 "!check_foreigns", file=file@entry=0x55c91df83be0 "/test/mtest/11.0_dbg/storage/innobase/include/trx0trx.h", line=line@entry=1162, function=function@entry=0x55c91dfb9870 "trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*)") at assert.c:101
      #8  0x000055c91d8ed039 in trx_t::check_bulk_buffer (table=<optimized out>, this=0x145d15054b80) at /test/mtest/11.0_dbg/storage/innobase/include/trx0trx.h:1162
      #9  row_ins_index_entry (thr=0x145cc0077178, entry=0x145cc0021a30, index=0x145cc0074c10) at /test/mtest/11.0_dbg/storage/innobase/row/row0ins.cc:3366
      #10 row_ins_index_entry_step (thr=0x145cc0077178, node=<optimized out>) at /test/mtest/11.0_dbg/storage/innobase/row/row0ins.cc:3543
      #11 row_ins (thr=0x145cc0077178, node=<optimized out>) at /test/mtest/11.0_dbg/storage/innobase/row/row0ins.cc:3660
      #12 row_ins_step (thr=thr@entry=0x145cc0077178) at /test/mtest/11.0_dbg/storage/innobase/row/row0ins.cc:3789
      #13 0x000055c91d90f2c7 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x145cc00734d8 "\377\001", prebuilt=0x145cc0076890, ins_mode=ROW_INS_NORMAL) at /test/mtest/11.0_dbg/storage/innobase/row/row0mysql.cc:1307
      #14 0x000055c91d7b29e3 in ha_innobase::write_row (this=0x145cc00753f0, record=0x145cc00734d8 "\377\001") at /test/mtest/11.0_dbg/storage/innobase/handler/ha_innodb.cc:7810
      #15 0x000055c91d7509fd in ha_sequence::write_row (this=0x145cc00738f0, buf=0x145cc00734d8 "\377\001") at /test/mtest/11.0_dbg/sql/ha_sequence.cc:223
      #16 0x000055c91d4af681 in handler::ha_write_row (this=0x145cc00738f0, buf=0x145cc00734d8 "\377\001") at /test/mtest/11.0_dbg/sql/handler.cc:7798
      #17 0x000055c91d3eda51 in sequence_definition::write_initial_sequence (this=this@entry=0x145cc0013988, table=0x145cc00730d8) at /test/mtest/11.0_dbg/sql/sql_sequence.cc:625
      #18 0x000055c91d3edc38 in sequence_insert (thd=thd@entry=0x145cc0000d48, lex=0x145cc0004eb8, org_table_list=org_table_list@entry=0x145cc0013268) at /test/mtest/11.0_dbg/sql/sql_sequence.cc:375
      #19 0x000055c91d295d74 in mysql_create_table_no_lock (thd=thd@entry=0x145cc0000d48, ddl_log_state_create=ddl_log_state_create@entry=0x145cfca23170, ddl_log_state_rm=ddl_log_state_rm@entry=0x145cfca23300, db=db@entry=0x145cc0013280, table_name=table_name@entry=0x145cc0013290, create_info=create_info@entry=0x145cfca233f0, alter_info=0x145cfca23210, is_trans=0x145cfca23150, create_table_mode=0, table_list=0x145cc0013268) at /test/mtest/11.0_dbg/sql/sql_table.cc:4786
      #20 0x000055c91d297c21 in mysql_create_table (alter_info=0x145cfca23210, create_info=0x145cfca233f0, create_table=0x145cc0013268, thd=0x145cc0000d48) at /test/mtest/11.0_dbg/sql/sql_table.cc:4888
      #21 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x145cc0000d48) at /test/mtest/11.0_dbg/sql/sql_table.cc:12492
      #22 0x000055c91d1b748c in mysql_execute_command (thd=thd@entry=0x145cc0000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/mtest/11.0_dbg/sql/sql_parse.cc:6015
      #23 0x000055c91d19f732 in mysql_parse (thd=thd@entry=0x145cc0000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x145cfca25300) at /test/mtest/11.0_dbg/sql/sql_parse.cc:8014
      #24 0x000055c91d1ad0b5 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x145cc0000d48, packet=packet@entry=0x145cc000ae39 "CREATE TEMPORARY SEQUENCE f", packet_length=packet_length@entry=27, blocking=blocking@entry=true) at /test/mtest/11.0_dbg/sql/sql_class.h:1370
      #25 0x000055c91d1af518 in do_command (thd=0x145cc0000d48, blocking=blocking@entry=true) at /test/mtest/11.0_dbg/sql/sql_parse.cc:1407
      #26 0x000055c91d31829e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c92143e128, put_in_cache=put_in_cache@entry=true) at /test/mtest/11.0_dbg/sql/sql_connect.cc:1416
      #27 0x000055c91d318770 in handle_one_connection (arg=0x55c92143e128) at /test/mtest/11.0_dbg/sql/sql_connect.cc:1318
      #28 0x0000145d15cb9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x0000145d158a5133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.8.8 (dbg), 10.9.7 (dbg), 10.10.5 (dbg), 10.11.4 (dbg), 11.0.2 (dbg), 11.1.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.30 (dbg), 10.4.30 (opt), 10.5.21 (dbg), 10.5.21 (opt), 10.6.14 (dbg), 10.6.14 (opt), 10.8.8 (opt), 10.9.7 (opt), 10.10.5 (opt), 10.11.4 (opt), 11.0.2 (opt), 11.1.0 (opt)

      Attachments

        Issue Links

          Activity

            Patch is in bb-10.9-MDEV-31298

            thiru Thirunarayanan Balathandayuthapani added a comment - Patch is in bb-10.9- MDEV-31298

            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
            

            marko Marko Mäkelä added a comment - 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

            cannot repeat, I'm getting

            mysqltest: At line 8: query 'CREATE TEMPORARY SEQUENCE f' failed: ER_XAER_RMFAIL (1399): XAER_RMFAIL: The command cannot be executed when global transaction is in the  ACTIVE state
            

            this is in latest 10.4, 10.9, and 11.3.

            serg Sergei Golubchik added a comment - cannot repeat, I'm getting mysqltest: At line 8: query 'CREATE TEMPORARY SEQUENCE f' failed: ER_XAER_RMFAIL (1399): XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state this is in latest 10.4, 10.9, and 11.3.

            On optimized builds I get the XAER_RMFAIL also. Debug crashes.

            Roel Roel Van de Paar added a comment - On optimized builds I get the XAER_RMFAIL also. Debug crashes.
            Roel Roel Van de Paar added a comment - - edited

            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)

            Roel Roel Van de Paar added a comment - - edited 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)
            Roel Roel Van de Paar added a comment - - edited

            Assigned back to thiru as bb-10.9-MDEV-31298 no longer seems to exist.

            Roel Roel Van de Paar added a comment - - edited Assigned back to thiru as bb-10.9-MDEV-31298 no longer seems to exist .

            My earlier comment about removing debug assertions was directed at this commit by thiru. I think that the SQL layer must prohibit the execution of any DDL statements within an XA transaction.

            marko Marko Mäkelä added a comment - My earlier comment about removing debug assertions was directed at this commit by thiru . I think that the SQL layer must prohibit the execution of any DDL statements within an XA transaction.

            People

              serg Sergei Golubchik
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.