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

Assertion `"lock not found" == 0' failed in lock_table_x_unlock

Details

    Description

      --source include/have_innodb.inc
       
      SET FOREIGN_KEY_CHECKS= OFF;
      CREATE TABLE t1 (id INT PRIMARY KEY, f INT, FOREIGN KEY (f) REFERENCES tx (x)) ENGINE=InnoDB;
      SET FOREIGN_KEY_CHECKS= ON;
      START TRANSACTION;
      INSERT IGNORE INTO t1 VALUES (1,11);
      REPLACE INTO t1 VALUES (1,12);
       
      # Cleanup
      COMMIT;
      DROP TABLE t1;
      

      10.6 3f871b33

      mariadbd: /data/src/10.6/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
      210126 21:26:52 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f6cdf0d0f36 in __GI___assert_fail (assertion=0x55a5a4893d30 "\"lock not found\" == 0", file=0x55a5a4891ed8 "/data/src/10.6/storage/innobase/lock/lock0lock.cc", line=3633, function=0x55a5a4893d00 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101
      #8  0x000055a5a4063bd0 in lock_table_x_unlock (table=0x7f6cac040db8, trx=0x7f6cd9723148) at /data/src/10.6/storage/innobase/lock/lock0lock.cc:3633
      #9  0x000055a5a42065bd in trx_t::rollback_low (this=0x7f6cd9723148, savept=0x7f6cd84776c0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:142
      #10 0x000055a5a4202c48 in trx_t::rollback (this=0x7f6cd9723148, savept=0x7f6cd84776c0) at /data/src/10.6/storage/innobase/trx/trx0roll.cc:170
      #11 0x000055a5a4161152 in row_mysql_handle_errors (new_err=0x7f6cd84776b8, trx=0x7f6cd9723148, thr=0x7f6cac1adf40, savept=0x7f6cd84776c0) at /data/src/10.6/storage/innobase/row/row0mysql.cc:731
      #12 0x000055a5a4162d9e in row_insert_for_mysql (mysql_rec=0x7f6cac2246e8 "\375\001", prebuilt=0x7f6cac1ad7b8, ins_mode=ROW_INS_NORMAL) at /data/src/10.6/storage/innobase/row/row0mysql.cc:1440
      #13 0x000055a5a3fb476a in ha_innobase::write_row (this=0x7f6cac1acaf0, record=0x7f6cac2246e8 "\375\001") at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:7338
      #14 0x000055a5a3b4a093 in handler::ha_write_row (this=0x7f6cac1acaf0, buf=0x7f6cac2246e8 "\375\001") at /data/src/10.6/sql/handler.cc:7151
      #15 0x000055a5a377cb15 in write_record (thd=0x7f6cac000db8, table=0x7f6cac226278, info=0x7f6cd8477c40, sink=0x0) at /data/src/10.6/sql/sql_insert.cc:1784
      #16 0x000055a5a377ab19 in mysql_insert (thd=0x7f6cac000db8, table_list=0x7f6cac013db0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false, result=0x0) at /data/src/10.6/sql/sql_insert.cc:1099
      #17 0x000055a5a37cdb22 in mysql_execute_command (thd=0x7f6cac000db8) at /data/src/10.6/sql/sql_parse.cc:4448
      #18 0x000055a5a37d97cc in mysql_parse (thd=0x7f6cac000db8, rawbuf=0x7f6cac013cd0 "REPLACE INTO t1 VALUES (1,12)", length=29, parser_state=0x7f6cd8478510) at /data/src/10.6/sql/sql_parse.cc:7901
      #19 0x000055a5a37c5d83 in dispatch_command (command=COM_QUERY, thd=0x7f6cac000db8, packet=0x7f6cac008e49 "REPLACE INTO t1 VALUES (1,12)", packet_length=29) at /data/src/10.6/sql/sql_parse.cc:1833
      #20 0x000055a5a37c479a in do_command (thd=0x7f6cac000db8) at /data/src/10.6/sql/sql_parse.cc:1365
      #21 0x000055a5a3971e7b in do_handle_one_connection (connect=0x55a5a6c651c8, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1410
      #22 0x000055a5a3971bde in handle_one_connection (arg=0x55a5a6d4a418) at /data/src/10.6/sql/sql_connect.cc:1312
      #23 0x000055a5a3eceb03 in pfs_spawn_thread (arg=0x55a5a6c64e08) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #24 0x00007f6cdf5e8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #25 0x00007f6cdf1bc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      On 10.5 REPLACE fails with ER_NO_REFERENCED_ROW_2 as it probably should:

      10.5 927a8823

      mysqltest: At line 8: query 'REPLACE INTO t1 VALUES (1,12)' failed: 1452: Cannot add or update a child row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`f`) REFERENCES `tx` (`x`))
      

      Attachments

        Issue Links

          Activity

            The IGNORE in the INSERT will disable the MDEV-515 logic. The INSERT will be ignored because the foreign key constraint cannot be fulfilled.
            Subsequently, the REPLACE was wrongly attempted to be executed as bulk insert, because the m_prebuilt->ins_node->bulk_insert was never reset. I think that it is cleanest to reset that flag in ha_innobase::reset_template().

            While debugging this, I noticed that I had made a mistake and assigned both flags WAS_BULK and BULK in trx_mod_table_time_t to the same value. That did not contribute to this failure.

            marko Marko Mäkelä added a comment - The IGNORE in the INSERT will disable the MDEV-515 logic. The INSERT will be ignored because the foreign key constraint cannot be fulfilled. Subsequently, the REPLACE was wrongly attempted to be executed as bulk insert, because the m_prebuilt->ins_node->bulk_insert was never reset. I think that it is cleanest to reset that flag in ha_innobase::reset_template() . While debugging this, I noticed that I had made a mistake and assigned both flags WAS_BULK and BULK in trx_mod_table_time_t to the same value. That did not contribute to this failure.

            origin/bb-10.6-MDEV-24700 b0e290010c0d4bc8d3a7c3602a32651c21d8becd 2021-01-27T11:15:57+02:00
            behaved well in RQG testing. But please note that it is quite possible that the big RQG test battery
            is unable to catch the error the current MDEV is based on. 
            

            mleich Matthias Leich added a comment - origin/bb-10.6-MDEV-24700 b0e290010c0d4bc8d3a7c3602a32651c21d8becd 2021-01-27T11:15:57+02:00 behaved well in RQG testing. But please note that it is quite possible that the big RQG test battery is unable to catch the error the current MDEV is based on.
            Roel Roel Van de Paar added a comment - - edited

            FYI, I also saw this one in 10.6 trunk @ revision 3f871b339429441ad907ecf7dfabdc414797e664. Single-threaded client run. No reduction success yet on 75k line testcase. Will not continue reduction attempts as crashing query looks as good as indentical. Confirmed that this revision (mine) is earlier then patch revision.

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664

            mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
            

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664

            Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --max_a'.
            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 0x152258bed700 (LWP 3446566))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055e8f6fa0210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055e8f67352d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000015226dabe859 in __GI_abort () at abort.c:79
            #6  0x000015226dabe729 in __assert_fail_base (fmt=0x15226dc54588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e8f7368eeb "\"lock not found\" == 0", file=0x55e8f7369308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92
            #7  0x000015226dacff36 in __GI___assert_fail (assertion=assertion@entry=0x55e8f7368eeb "\"lock not found\" == 0", file=file@entry=0x55e8f7369308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x55e8f736b018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101
            #8  0x000055e8f6bc90ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x152258ef3260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633
            #9  0x000055e8f6d5b71d in trx_t::rollback_low (this=this@entry=0x152258ef3260, savept=savept@entry=0x152258ef4290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142
            #10 0x000055e8f6d55fd7 in trx_t::rollback (this=this@entry=0x152258ef3260, savept=savept@entry=0x152258ef4290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170
            #11 0x000055e8f6d56256 in trx_rollback_last_sql_stat_for_mysql (trx=trx@entry=0x152258ef3260) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:304
            #12 0x000055e8f6b26db9 in innobase_rollback (hton=<optimized out>, thd=0x152208000db8, rollback_trx=<optimized out>) at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4097
            #13 0x000055e8f673aa59 in ha_rollback_trans (thd=thd@entry=0x152208000db8, all=all@entry=false) at /data/builds/10.6_dbg/sql/handler.cc:2053
            #14 0x000055e8f65e05f0 in trans_rollback_stmt (thd=thd@entry=0x152208000db8) at /data/builds/10.6_dbg/sql/transaction.cc:535
            #15 0x000055e8f6476fbb in mysql_execute_command (thd=thd@entry=0x152208000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:5928
            #16 0x000055e8f645d15e in mysql_parse (thd=thd@entry=0x152208000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152258bec3d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901
            #17 0x000055e8f646b24f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152208000db8, packet=packet@entry=0x1522094dbad9 "replace into t values (1);", packet_length=packet_length@entry=26) at /data/builds/10.6_dbg/sql/sql_class.h:1294
            #18 0x000055e8f646e581 in do_command (thd=0x152208000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365
            #19 0x000055e8f65ca079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55e8fa1576a8, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410
            #20 0x000055e8f65ca77d in handle_one_connection (arg=arg@entry=0x55e8fa1576a8) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312
            #21 0x000055e8f6a7d43f in pfs_spawn_thread (arg=0x55e8fa0b6f18) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201
            #22 0x000015226dfcc609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #23 0x000015226dbbb293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664

            2021-01-29 18:37:40 8 [ERROR] mysqld: The table 't1' is full
            2021-01-29 18:37:40 8 [ERROR] mysqld: The table 't1' is full
            mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
            210129 18:37:40 [ERROR] mysqld got signal 6 ;
            ...
            Query (0x152208eb8da0): replace into t values (1)
            

            Roel Roel Van de Paar added a comment - - edited FYI, I also saw this one in 10.6 trunk @ revision 3f871b339429441ad907ecf7dfabdc414797e664 . Single-threaded client run. No reduction success yet on 75k line testcase. Will not continue reduction attempts as crashing query looks as good as indentical. Confirmed that this revision (mine) is earlier then patch revision. 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed. 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --max_a'. 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 0x152258bed700 (LWP 3446566))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055e8f6fa0210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055e8f67352d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000015226dabe859 in __GI_abort () at abort.c:79 #6 0x000015226dabe729 in __assert_fail_base (fmt=0x15226dc54588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e8f7368eeb "\"lock not found\" == 0", file=0x55e8f7369308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92 #7 0x000015226dacff36 in __GI___assert_fail (assertion=assertion@entry=0x55e8f7368eeb "\"lock not found\" == 0", file=file@entry=0x55e8f7369308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x55e8f736b018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101 #8 0x000055e8f6bc90ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x152258ef3260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633 #9 0x000055e8f6d5b71d in trx_t::rollback_low (this=this@entry=0x152258ef3260, savept=savept@entry=0x152258ef4290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142 #10 0x000055e8f6d55fd7 in trx_t::rollback (this=this@entry=0x152258ef3260, savept=savept@entry=0x152258ef4290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170 #11 0x000055e8f6d56256 in trx_rollback_last_sql_stat_for_mysql (trx=trx@entry=0x152258ef3260) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:304 #12 0x000055e8f6b26db9 in innobase_rollback (hton=<optimized out>, thd=0x152208000db8, rollback_trx=<optimized out>) at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4097 #13 0x000055e8f673aa59 in ha_rollback_trans (thd=thd@entry=0x152208000db8, all=all@entry=false) at /data/builds/10.6_dbg/sql/handler.cc:2053 #14 0x000055e8f65e05f0 in trans_rollback_stmt (thd=thd@entry=0x152208000db8) at /data/builds/10.6_dbg/sql/transaction.cc:535 #15 0x000055e8f6476fbb in mysql_execute_command (thd=thd@entry=0x152208000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:5928 #16 0x000055e8f645d15e in mysql_parse (thd=thd@entry=0x152208000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152258bec3d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901 #17 0x000055e8f646b24f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152208000db8, packet=packet@entry=0x1522094dbad9 "replace into t values (1);", packet_length=packet_length@entry=26) at /data/builds/10.6_dbg/sql/sql_class.h:1294 #18 0x000055e8f646e581 in do_command (thd=0x152208000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365 #19 0x000055e8f65ca079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55e8fa1576a8, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410 #20 0x000055e8f65ca77d in handle_one_connection (arg=arg@entry=0x55e8fa1576a8) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312 #21 0x000055e8f6a7d43f in pfs_spawn_thread (arg=0x55e8fa0b6f18) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201 #22 0x000015226dfcc609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #23 0x000015226dbbb293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 2021-01-29 18:37:40 8 [ERROR] mysqld: The table 't1' is full 2021-01-29 18:37:40 8 [ERROR] mysqld: The table 't1' is full mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed. 210129 18:37:40 [ERROR] mysqld got signal 6 ; ... Query (0x152208eb8da0): replace into t values (1)
            Roel Roel Van de Paar added a comment - - edited

            I think this was from just before the fix: tree build date 26/1/21.

            CREATE TABLE t (pk INT) ENGINE=InnoDB;
            CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW REPLACE INTO s VALUES(1);
            XA START 'a';
            INSERT INTO t VALUES(1);  # Gives error 'ERROR 1146 (42S02): Table 'test.s' doesn't exist'
            REPLACE t VALUES(1);
            

            Leads to:

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

            mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
            

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

            Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            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 0x1547c8784700 (LWP 2245782))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055b6a9be3210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055b6a93782d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x00001547cb342859 in __GI_abort () at abort.c:79
            #6  0x00001547cb342729 in __assert_fail_base (fmt=0x1547cb4d8588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b6a9fabeeb "\"lock not found\" == 0", file=0x55b6a9fac308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92
            #7  0x00001547cb353f36 in __GI___assert_fail (assertion=assertion@entry=0x55b6a9fabeeb "\"lock not found\" == 0", file=file@entry=0x55b6a9fac308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x55b6a9fae018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101
            #8  0x000055b6a980c0ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x1547c8a3f260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633
            #9  0x000055b6a999e71d in trx_t::rollback_low (this=this@entry=0x1547c8a3f260, savept=savept@entry=0x1547c8a40290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142
            #10 0x000055b6a9998fd7 in trx_t::rollback (this=this@entry=0x1547c8a3f260, savept=savept@entry=0x1547c8a40290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170
            #11 0x000055b6a9999256 in trx_rollback_last_sql_stat_for_mysql (trx=trx@entry=0x1547c8a3f260) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:304
            #12 0x000055b6a9769db9 in innobase_rollback (hton=<optimized out>, thd=0x154784000db8, rollback_trx=<optimized out>) at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4097
            #13 0x000055b6a937da59 in ha_rollback_trans (thd=thd@entry=0x154784000db8, all=all@entry=false) at /data/builds/10.6_dbg/sql/handler.cc:2053
            #14 0x000055b6a92235f0 in trans_rollback_stmt (thd=thd@entry=0x154784000db8) at /data/builds/10.6_dbg/sql/transaction.cc:535
            #15 0x000055b6a90b9fbb in mysql_execute_command (thd=thd@entry=0x154784000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:5928
            #16 0x000055b6a90a015e in mysql_parse (thd=thd@entry=0x154784000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1547c87833d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901
            #17 0x000055b6a90ae24f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154784000db8, packet=packet@entry=0x15478401aac9 "REPLACE t VALUES(1)", packet_length=packet_length@entry=19) at /data/builds/10.6_dbg/sql/sql_class.h:1294
            #18 0x000055b6a90b1581 in do_command (thd=0x154784000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365
            #19 0x000055b6a920d079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b6ab9e7a58, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410
            #20 0x000055b6a920d77d in handle_one_connection (arg=arg@entry=0x55b6ab9e7a58) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312
            #21 0x000055b6a96c043f in pfs_spawn_thread (arg=0x55b6ab91c108) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201
            #22 0x00001547cb850609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #23 0x00001547cb43f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.6.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            Roel Roel Van de Paar added a comment - - edited I think this was from just before the fix: tree build date 26/1/21. CREATE TABLE t (pk INT) ENGINE=InnoDB; CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW REPLACE INTO s VALUES(1); XA START 'a'; INSERT INTO t VALUES(1); # Gives error 'ERROR 1146 (42S02): Table 'test.s' doesn't exist' REPLACE t VALUES(1); Leads to: 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug) mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed. 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug) Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. 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 0x1547c8784700 (LWP 2245782))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055b6a9be3210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055b6a93782d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x00001547cb342859 in __GI_abort () at abort.c:79 #6 0x00001547cb342729 in __assert_fail_base (fmt=0x1547cb4d8588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b6a9fabeeb "\"lock not found\" == 0", file=0x55b6a9fac308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92 #7 0x00001547cb353f36 in __GI___assert_fail (assertion=assertion@entry=0x55b6a9fabeeb "\"lock not found\" == 0", file=file@entry=0x55b6a9fac308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x55b6a9fae018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101 #8 0x000055b6a980c0ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x1547c8a3f260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633 #9 0x000055b6a999e71d in trx_t::rollback_low (this=this@entry=0x1547c8a3f260, savept=savept@entry=0x1547c8a40290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142 #10 0x000055b6a9998fd7 in trx_t::rollback (this=this@entry=0x1547c8a3f260, savept=savept@entry=0x1547c8a40290) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170 #11 0x000055b6a9999256 in trx_rollback_last_sql_stat_for_mysql (trx=trx@entry=0x1547c8a3f260) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:304 #12 0x000055b6a9769db9 in innobase_rollback (hton=<optimized out>, thd=0x154784000db8, rollback_trx=<optimized out>) at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4097 #13 0x000055b6a937da59 in ha_rollback_trans (thd=thd@entry=0x154784000db8, all=all@entry=false) at /data/builds/10.6_dbg/sql/handler.cc:2053 #14 0x000055b6a92235f0 in trans_rollback_stmt (thd=thd@entry=0x154784000db8) at /data/builds/10.6_dbg/sql/transaction.cc:535 #15 0x000055b6a90b9fbb in mysql_execute_command (thd=thd@entry=0x154784000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:5928 #16 0x000055b6a90a015e in mysql_parse (thd=thd@entry=0x154784000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1547c87833d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901 #17 0x000055b6a90ae24f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154784000db8, packet=packet@entry=0x15478401aac9 "REPLACE t VALUES(1)", packet_length=packet_length@entry=19) at /data/builds/10.6_dbg/sql/sql_class.h:1294 #18 0x000055b6a90b1581 in do_command (thd=0x154784000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365 #19 0x000055b6a920d079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b6ab9e7a58, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410 #20 0x000055b6a920d77d in handle_one_connection (arg=arg@entry=0x55b6ab9e7a58) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312 #21 0x000055b6a96c043f in pfs_spawn_thread (arg=0x55b6ab91c108) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201 #22 0x00001547cb850609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #23 0x00001547cb43f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.6.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            One more seen. Again pre-patch. Perhaps good to add these testcases to MTR.

            CREATE TABLE t (a INT KEY,b CHAR(1)) ENGINE=InnoDB;
            CREATE TABLE t2 (b INT,FOREIGN KEY(b)REFERENCES t (a)) ENGINE=InnoDB;
            XA START 'x';
            INSERT INTO t2 VALUES(1);  # Gives ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t` (`a`))
            REPLACE t2 VALUES(1);
            

            Leads to:

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

            mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
            

            10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

            Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            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 0x14d8b0064700 (LWP 68953))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x0000561c6486e210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424
            #2  0x0000561c640032d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014d8b241f859 in __GI_abort () at abort.c:79
            #6  0x000014d8b241f729 in __assert_fail_base (fmt=0x14d8b25b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561c64c36eeb "\"lock not found\" == 0", file=0x561c64c37308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92
            #7  0x000014d8b2430f36 in __GI___assert_fail (assertion=assertion@entry=0x561c64c36eeb "\"lock not found\" == 0", file=file@entry=0x561c64c37308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x561c64c39018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101
            #8  0x0000561c644970ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x14d89d755260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633
            #9  0x0000561c6462971d in trx_t::rollback_low (this=this@entry=0x14d89d755260, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142
            #10 0x0000561c64623fd7 in trx_t::rollback (this=this@entry=0x14d89d755260, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170
            #11 0x0000561c64584d39 in row_mysql_handle_errors (new_err=new_err@entry=0x14d8b0062734, trx=trx@entry=0x14d89d755260, thr=thr@entry=0x14d860030738, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/row/row0mysql.cc:731
            #12 0x0000561c6458609d in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14d86002f348 "\375\001", prebuilt=0x14d860030008, ins_mode=ROW_INS_NORMAL) at /data/builds/10.6_dbg/storage/innobase/row/row0mysql.cc:1440
            #13 0x0000561c6440ed8a in ha_innobase::write_row (this=0x14d86002f7b0, record=0x14d86002f348 "\375\001") at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:7338
            #14 0x0000561c64017618 in handler::ha_write_row (this=0x14d86002f7b0, buf=0x14d86002f348 "\375\001") at /data/builds/10.6_dbg/sql/handler.cc:7151
            #15 0x0000561c63cec7f8 in write_record (thd=thd@entry=0x14d860000db8, table=table@entry=0x14d860025f28, info=info@entry=0x14d8b0062c60, sink=sink@entry=0x0) at /data/builds/10.6_dbg/sql/sql_insert.cc:1784
            #16 0x0000561c63cf9b4e in mysql_insert (thd=thd@entry=0x14d860000db8, table_list=0x14d860012790, fields=@0x14d860005e28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e28, elements = 0}, <No data fields>}, values_list=@0x14d860005e70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d860013398, last = 0x14d860013398, elements = 1}, <No data fields>}, update_fields=@0x14d860005e58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e58, elements = 0}, <No data fields>}, update_values=@0x14d860005e40: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e40, elements = 0}, <No data fields>}, duplic=DUP_REPLACE, ignore=false, result=0x0) at /data/builds/10.6_dbg/sql/sql_insert.cc:1099
            #17 0x0000561c63d406a8 in mysql_execute_command (thd=thd@entry=0x14d860000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:4448
            #18 0x0000561c63d2b15e in mysql_parse (thd=thd@entry=0x14d860000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8b00633d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901
            #19 0x0000561c63d3924f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d860000db8, packet=packet@entry=0x14d86001aac9 "REPLACE t2 VALUES(1)", packet_length=packet_length@entry=20) at /data/builds/10.6_dbg/sql/sql_class.h:1294
            #20 0x0000561c63d3c581 in do_command (thd=0x14d860000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365
            #21 0x0000561c63e98079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561c666bf058, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410
            #22 0x0000561c63e9877d in handle_one_connection (arg=arg@entry=0x561c666bf058) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312
            #23 0x0000561c6434b43f in pfs_spawn_thread (arg=0x561c665f3158) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201
            #24 0x000014d8b292d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #25 0x000014d8b251c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.6.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            Roel Roel Van de Paar added a comment - One more seen. Again pre-patch. Perhaps good to add these testcases to MTR. CREATE TABLE t (a INT KEY,b CHAR(1)) ENGINE=InnoDB; CREATE TABLE t2 (b INT,FOREIGN KEY(b)REFERENCES t (a)) ENGINE=InnoDB; XA START 'x'; INSERT INTO t2 VALUES(1); # Gives ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t` (`a`)) REPLACE t2 VALUES(1); Leads to: 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug) mysqld: /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed. 10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug) Core was generated by `/test/MD260121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. 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 0x14d8b0064700 (LWP 68953))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x0000561c6486e210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424 #2 0x0000561c640032d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014d8b241f859 in __GI_abort () at abort.c:79 #6 0x000014d8b241f729 in __assert_fail_base (fmt=0x14d8b25b5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561c64c36eeb "\"lock not found\" == 0", file=0x561c64c37308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3633, function=<optimized out>) at assert.c:92 #7 0x000014d8b2430f36 in __GI___assert_fail (assertion=assertion@entry=0x561c64c36eeb "\"lock not found\" == 0", file=file@entry=0x561c64c37308 "/data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3633, function=function@entry=0x561c64c39018 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101 #8 0x0000561c644970ea in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x14d89d755260) at /data/builds/10.6_dbg/storage/innobase/lock/lock0lock.cc:3633 #9 0x0000561c6462971d in trx_t::rollback_low (this=this@entry=0x14d89d755260, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:142 #10 0x0000561c64623fd7 in trx_t::rollback (this=this@entry=0x14d89d755260, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/trx/trx0roll.cc:170 #11 0x0000561c64584d39 in row_mysql_handle_errors (new_err=new_err@entry=0x14d8b0062734, trx=trx@entry=0x14d89d755260, thr=thr@entry=0x14d860030738, savept=savept@entry=0x14d8b0062738) at /data/builds/10.6_dbg/storage/innobase/row/row0mysql.cc:731 #12 0x0000561c6458609d in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14d86002f348 "\375\001", prebuilt=0x14d860030008, ins_mode=ROW_INS_NORMAL) at /data/builds/10.6_dbg/storage/innobase/row/row0mysql.cc:1440 #13 0x0000561c6440ed8a in ha_innobase::write_row (this=0x14d86002f7b0, record=0x14d86002f348 "\375\001") at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:7338 #14 0x0000561c64017618 in handler::ha_write_row (this=0x14d86002f7b0, buf=0x14d86002f348 "\375\001") at /data/builds/10.6_dbg/sql/handler.cc:7151 #15 0x0000561c63cec7f8 in write_record (thd=thd@entry=0x14d860000db8, table=table@entry=0x14d860025f28, info=info@entry=0x14d8b0062c60, sink=sink@entry=0x0) at /data/builds/10.6_dbg/sql/sql_insert.cc:1784 #16 0x0000561c63cf9b4e in mysql_insert (thd=thd@entry=0x14d860000db8, table_list=0x14d860012790, fields=@0x14d860005e28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e28, elements = 0}, <No data fields>}, values_list=@0x14d860005e70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d860013398, last = 0x14d860013398, elements = 1}, <No data fields>}, update_fields=@0x14d860005e58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e58, elements = 0}, <No data fields>}, update_values=@0x14d860005e40: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x561c653112e0 <end_of_list>, last = 0x14d860005e40, elements = 0}, <No data fields>}, duplic=DUP_REPLACE, ignore=false, result=0x0) at /data/builds/10.6_dbg/sql/sql_insert.cc:1099 #17 0x0000561c63d406a8 in mysql_execute_command (thd=thd@entry=0x14d860000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:4448 #18 0x0000561c63d2b15e in mysql_parse (thd=thd@entry=0x14d860000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d8b00633d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901 #19 0x0000561c63d3924f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d860000db8, packet=packet@entry=0x14d86001aac9 "REPLACE t2 VALUES(1)", packet_length=packet_length@entry=20) at /data/builds/10.6_dbg/sql/sql_class.h:1294 #20 0x0000561c63d3c581 in do_command (thd=0x14d860000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365 #21 0x0000561c63e98079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561c666bf058, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410 #22 0x0000561c63e9877d in handle_one_connection (arg=arg@entry=0x561c666bf058) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312 #23 0x0000561c6434b43f in pfs_spawn_thread (arg=0x561c665f3158) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201 #24 0x000014d8b292d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #25 0x000014d8b251c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.6.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            Another occurrence in earlier build, seems also fixed in pull from build made today (tested to not fail against 420f8e24ab73ef00b323aaa9423f365fb38e9306)

            SET sql_mode='';
            CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
            CREATE TABLE t2(c INT);
            XA START 'a';
            SELECT d FROM t2;
            SAVEPOINT x;
            INSERT INTO t2 VALUES(0);
            INSERT INTO t VALUES(0), (0);
            INSERT INTO t VALUES(0);
            ROLLBACK TO SAVEPOINT x;
            

            Leads to:

            10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:3706: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed.
            

            10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

            Core was generated by `/test/MD110221-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            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 0x1480e459d700 (LWP 201438))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055c0017ba55c in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055c000f524de in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x00001480e715b859 in __GI_abort () at abort.c:79
            #6  0x00001480e715b729 in __assert_fail_base (fmt=0x1480e72f1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c001b82423 "\"lock not found\" == 0", file=0x55c001b82768 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3706, function=<optimized out>) at assert.c:92
            #7  0x00001480e716cf36 in __GI___assert_fail (assertion=assertion@entry=0x55c001b82423 "\"lock not found\" == 0", file=file@entry=0x55c001b82768 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3706, function=function@entry=0x55c001b842c8 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101
            #8  0x000055c0013e6e34 in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x1480e48582a0) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:3706
            #9  0x000055c001576455 in trx_t::rollback_low (this=this@entry=0x1480e48582a0, savept=savept@entry=0x14808c008040) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:141
            #10 0x000055c001572f42 in trx_t::rollback (this=this@entry=0x1480e48582a0, savept=savept@entry=0x14808c008040) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:169
            #11 0x000055c00157355a in trx_rollback_to_savepoint_for_mysql_low (mysql_binlog_cache_pos=0x1480e459bc38, savep=0x14808c008038, trx=0x1480e48582a0) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:424
            #12 trx_rollback_to_savepoint_for_mysql (trx=trx@entry=0x1480e48582a0, savepoint_name=savepoint_name@entry=0x1480e459bc60 "7ZNT1L9D4", mysql_binlog_cache_pos=mysql_binlog_cache_pos@entry=0x1480e459bc38) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:483
            #13 0x000055c00134474c in innobase_rollback_to_savepoint (hton=<optimized out>, thd=0x14808c000db8, savepoint=0x14808c0187a8) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4312
            #14 0x000055c000f587aa in ha_rollback_to_savepoint (thd=thd@entry=0x14808c000db8, sv=sv@entry=0x14808c018770) at /test/10.6_dbg/sql/handler.cc:2501
            #15 0x000055c000dfdaba in trans_rollback_to_savepoint (thd=thd@entry=0x14808c000db8, name=<optimized out>) at /test/10.6_dbg/sql/transaction.cc:697
            #16 0x000055c000c92915 in mysql_execute_command (thd=thd@entry=0x14808c000db8) at /test/10.6_dbg/sql/sql_parse.cc:5577
            #17 0x000055c000c7a21a in mysql_parse (thd=thd@entry=0x14808c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1480e459c3d0) at /test/10.6_dbg/sql/sql_parse.cc:7906
            #18 0x000055c000c8830b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14808c000db8, packet=packet@entry=0x14808c01aac9 "ROLLBACK TO SAVEPOINT x", packet_length=packet_length@entry=23) at /test/10.6_dbg/sql/sql_class.h:1295
            #19 0x000055c000c8b63d in do_command (thd=0x14808c000db8) at /test/10.6_dbg/sql/sql_parse.cc:1365
            #20 0x000055c000de71ab in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c004774848, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #21 0x000055c000de78af in handle_one_connection (arg=arg@entry=0x55c004774848) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #22 0x000055c00129b27d in pfs_spawn_thread (arg=0x55c0046a8ef8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #23 0x00001480e7669609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #24 0x00001480e7258293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.6.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            Roel Roel Van de Paar added a comment - Another occurrence in earlier build, seems also fixed in pull from build made today (tested to not fail against 420f8e24ab73ef00b323aaa9423f365fb38e9306 ) SET sql_mode=''; CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t2(c INT); XA START 'a'; SELECT d FROM t2; SAVEPOINT x; INSERT INTO t2 VALUES(0); INSERT INTO t VALUES(0), (0); INSERT INTO t VALUES(0); ROLLBACK TO SAVEPOINT x; Leads to: 10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug) mysqld: /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:3706: void lock_table_x_unlock(dict_table_t*, trx_t*): Assertion `"lock not found" == 0' failed. 10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug) Core was generated by `/test/MD110221-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. 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 0x1480e459d700 (LWP 201438))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055c0017ba55c in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055c000f524de in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x00001480e715b859 in __GI_abort () at abort.c:79 #6 0x00001480e715b729 in __assert_fail_base (fmt=0x1480e72f1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c001b82423 "\"lock not found\" == 0", file=0x55c001b82768 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=3706, function=<optimized out>) at assert.c:92 #7 0x00001480e716cf36 in __GI___assert_fail (assertion=assertion@entry=0x55c001b82423 "\"lock not found\" == 0", file=file@entry=0x55c001b82768 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=3706, function=function@entry=0x55c001b842c8 "void lock_table_x_unlock(dict_table_t*, trx_t*)") at assert.c:101 #8 0x000055c0013e6e34 in lock_table_x_unlock (table=<optimized out>, trx=trx@entry=0x1480e48582a0) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:3706 #9 0x000055c001576455 in trx_t::rollback_low (this=this@entry=0x1480e48582a0, savept=savept@entry=0x14808c008040) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:141 #10 0x000055c001572f42 in trx_t::rollback (this=this@entry=0x1480e48582a0, savept=savept@entry=0x14808c008040) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:169 #11 0x000055c00157355a in trx_rollback_to_savepoint_for_mysql_low (mysql_binlog_cache_pos=0x1480e459bc38, savep=0x14808c008038, trx=0x1480e48582a0) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:424 #12 trx_rollback_to_savepoint_for_mysql (trx=trx@entry=0x1480e48582a0, savepoint_name=savepoint_name@entry=0x1480e459bc60 "7ZNT1L9D4", mysql_binlog_cache_pos=mysql_binlog_cache_pos@entry=0x1480e459bc38) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:483 #13 0x000055c00134474c in innobase_rollback_to_savepoint (hton=<optimized out>, thd=0x14808c000db8, savepoint=0x14808c0187a8) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4312 #14 0x000055c000f587aa in ha_rollback_to_savepoint (thd=thd@entry=0x14808c000db8, sv=sv@entry=0x14808c018770) at /test/10.6_dbg/sql/handler.cc:2501 #15 0x000055c000dfdaba in trans_rollback_to_savepoint (thd=thd@entry=0x14808c000db8, name=<optimized out>) at /test/10.6_dbg/sql/transaction.cc:697 #16 0x000055c000c92915 in mysql_execute_command (thd=thd@entry=0x14808c000db8) at /test/10.6_dbg/sql/sql_parse.cc:5577 #17 0x000055c000c7a21a in mysql_parse (thd=thd@entry=0x14808c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1480e459c3d0) at /test/10.6_dbg/sql/sql_parse.cc:7906 #18 0x000055c000c8830b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14808c000db8, packet=packet@entry=0x14808c01aac9 "ROLLBACK TO SAVEPOINT x", packet_length=packet_length@entry=23) at /test/10.6_dbg/sql/sql_class.h:1295 #19 0x000055c000c8b63d in do_command (thd=0x14808c000db8) at /test/10.6_dbg/sql/sql_parse.cc:1365 #20 0x000055c000de71ab in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c004774848, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410 #21 0x000055c000de78af in handle_one_connection (arg=arg@entry=0x55c004774848) at /test/10.6_dbg/sql/sql_connect.cc:1312 #22 0x000055c00129b27d in pfs_spawn_thread (arg=0x55c0046a8ef8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201 #23 0x00001480e7669609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #24 0x00001480e7258293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.6.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (dbg), 10.3.28 (opt), 10.4.18 (dbg), 10.4.18 (opt), 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              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.