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

Assertion `prebuilt->trx_id < table->def_trx_id' failed in row_get_prebuilt_insert_row

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a)) ENGINE=InnoDB;
      SET FOREIGN_KEY_CHECKS= OFF;
      ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a), ALGORITHM=COPY;
      INSERT INTO t1 VALUES (1,1);
      LOCK TABLES t1 WRITE;
      --error ER_CANNOT_ADD_FOREIGN
      TRUNCATE t1;
      INSERT INTO t1 VALUES (2,2);
      

      10.6 c2ebe814

      mariadbd: /data/src/10.6/storage/innobase/row/row0mysql.cc:1057: dtuple_t* row_get_prebuilt_insert_row(row_prebuilt_t*): Assertion `prebuilt->trx_id < table->def_trx_id' failed.
      210630 15:56:00 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe34ae9cf36 in __GI___assert_fail (assertion=0x55b6758e8758 "prebuilt->trx_id < table->def_trx_id", file=0x55b6758e7ce8 "/data/src/10.6/storage/innobase/row/row0mysql.cc", line=1057, function=0x55b6758e8720 "dtuple_t* row_get_prebuilt_insert_row(row_prebuilt_t*)") at assert.c:101
      #8  0x000055b67515f366 in row_get_prebuilt_insert_row (prebuilt=0x7fe318146ae8) at /data/src/10.6/storage/innobase/row/row0mysql.cc:1057
      #9  0x000055b67515fd7c in row_insert_for_mysql (mysql_rec=0x7fe318236af8 "\375\002", prebuilt=0x7fe318146ae8, ins_mode=ROW_INS_NORMAL) at /data/src/10.6/storage/innobase/row/row0mysql.cc:1311
      #10 0x000055b674fa40af in ha_innobase::write_row (this=0x7fe318146290, record=0x7fe318236af8 "\375\002") at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:7780
      #11 0x000055b674b2dbc1 in handler::ha_write_row (this=0x7fe318146290, buf=0x7fe318236af8 "\375\002") at /data/src/10.6/sql/handler.cc:7500
      #12 0x000055b674744300 in write_record (thd=0x7fe318000db8, table=0x7fe318224c08, info=0x7fe3440e3bd0, sink=0x0) at /data/src/10.6/sql/sql_insert.cc:2113
      #13 0x000055b674740fe7 in mysql_insert (thd=0x7fe318000db8, table_list=0x7fe3180156a0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false, result=0x0) at /data/src/10.6/sql/sql_insert.cc:1104
      #14 0x000055b674795e53 in mysql_execute_command (thd=0x7fe318000db8, is_called_from_prepared_stmt=false) at /data/src/10.6/sql/sql_parse.cc:4568
      #15 0x000055b6747a191f in mysql_parse (thd=0x7fe318000db8, rawbuf=0x7fe3180155c0 "INSERT INTO t1 VALUES (2,2)", length=27, parser_state=0x7fe3440e4480) at /data/src/10.6/sql/sql_parse.cc:8028
      #16 0x000055b67478dd59 in dispatch_command (command=COM_QUERY, thd=0x7fe318000db8, packet=0x7fe31800b879 "INSERT INTO t1 VALUES (2,2)", packet_length=27, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1898
      #17 0x000055b67478c6f5 in do_command (thd=0x7fe318000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1406
      #18 0x000055b6749493cb in do_handle_one_connection (connect=0x55b6773a7db8, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1410
      #19 0x000055b674949127 in handle_one_connection (arg=0x55b6773a7828) at /data/src/10.6/sql/sql_connect.cc:1312
      #20 0x000055b674eb9313 in pfs_spawn_thread (arg=0x55b6773a7908) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #21 0x00007fe34b3b5609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x00007fe34af88293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure started happening on 10.6 after this commit:

      commit 1bd681c8b3c5213ce1f7976940a7dc38b48a0d39
      Author: Marko Mäkelä
      Date:   Wed Jun 9 17:02:55 2021 +0300
       
          MDEV-25506 (3 of 3): Do not delete .ibd files before commit
      

      It is possible the the problem starts already with a questionably succeeding ALTER which lacks consistency in its behavior (see MDEV-26051 for some details).

      Other than that, no immediately obvious problems on a non-debug build.

      Attachments

        Activity

          People

            marko Marko Mäkelä
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.