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

Assertion `lock_table_has(trx, index->table, LOCK_IX)' failed in lock_rec_insert_check_and_lock upon INSERT into table with blob key

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (
        id INT NOT NULL AUTO_INCREMENT,
        f INT NOT NULL DEFAULT 0,
        PRIMARY KEY (id),
        UNIQUE (f)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t2 (
        id INT NOT NULL AUTO_INCREMENT,
        a TEXT DEFAULT '',
        PRIMARY KEY (id),
        UNIQUE (a)
      ) ENGINE=InnoDB;
       
      SET innodb_lock_wait_timeout= 1;
      START TRANSACTION;
       
      --connect (con1,localhost,root,,test)
      SET innodb_lock_wait_timeout= 1;
      START TRANSACTION;
      INSERT INTO t1 (f) VALUES (1);
       
      --connection default
      INSERT INTO t2 (id) VALUES (NULL) ;
      --connection con1
       
      --send
        INSERT INTO t2 (id) VALUES (NULL);
       
      --connection default
      INSERT IGNORE INTO t1 (f) VALUES (1);
       
      # Cleanup
      --connection con1
      --reap
      --disconnect con1
      --connection default
      DROP TABLE t1, t2;
      

      10.4 47b7ca62

      mysqld: /data/src/10.4/storage/innobase/lock/lock0lock.cc:5329: dberr_t lock_rec_insert_check_and_lock(ulint, const rec_t*, buf_block_t*, dict_index_t*, que_thr_t*, mtr_t*, bool*): Assertion `lock_table_has(trx, index->table, LOCK_IX)' failed.
      190305 12:45:56 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f59a5784ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005584cdb7a934 in lock_rec_insert_check_and_lock (flags=0, rec=0x7f599b0f407f "\200", block=0x7f599abde720, index=0x7f5948151318, thr=0x7f5948154ad0, mtr=0x7f59a00b2fa0, inherit=0x7f59a00b2749) at /data/src/10.4/storage/innobase/lock/lock0lock.cc:5329
      #9  0x00005584cdd3cdc5 in btr_cur_ins_lock_and_undo (flags=0, cursor=0x7f59a00b2b80, entry=0x7f5948156df8, thr=0x7f5948154ad0, mtr=0x7f59a00b2fa0, inherit=0x7f59a00b2749) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3248
      #10 0x00005584cdd3d8e6 in btr_cur_optimistic_insert (flags=0, cursor=0x7f59a00b2b80, offsets=0x7f59a00b2b18, heap=0x7f59a00b2b10, entry=0x7f5948156df8, rec=0x7f59a00b2b20, big_rec=0x7f59a00b2b08, n_ext=0, thr=0x7f5948154ad0, mtr=0x7f59a00b2fa0) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3483
      #11 0x00005584cdc250fb in row_ins_clust_index_entry_low (flags=0, mode=2, index=0x7f5948151318, n_uniq=1, entry=0x7f5948156df8, n_ext=0, thr=0x7f5948154ad0, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2756
      #12 0x00005584cdc26a35 in row_ins_clust_index_entry (index=0x7f5948151318, entry=0x7f5948156df8, thr=0x7f5948154ad0, n_ext=0, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:3280
      #13 0x00005584cdc26f53 in row_ins_index_entry (index=0x7f5948151318, entry=0x7f5948156df8, thr=0x7f5948154ad0) at /data/src/10.4/storage/innobase/row/row0ins.cc:3405
      #14 0x00005584cdc27695 in row_ins_index_entry_step (node=0x7f5948154838, thr=0x7f5948154ad0) at /data/src/10.4/storage/innobase/row/row0ins.cc:3574
      #15 0x00005584cdc27ac9 in row_ins (node=0x7f5948154838, thr=0x7f5948154ad0) at /data/src/10.4/storage/innobase/row/row0ins.cc:3717
      #16 0x00005584cdc282d2 in row_ins_step (thr=0x7f5948154ad0) at /data/src/10.4/storage/innobase/row/row0ins.cc:3962
      #17 0x00005584cdc4802c in row_insert_for_mysql (mysql_rec=0x7f5948009e30 "\374\002", prebuilt=0x7f5948154038, ins_mode=ROW_INS_NORMAL) at /data/src/10.4/storage/innobase/row/row0mysql.cc:1460
      #18 0x00005584cdae2966 in ha_innobase::write_row (this=0x7f5948150618, record=0x7f5948009e30 "\374\002") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:8086
      #19 0x00005584cd7aaafc in handler::ha_write_row (this=0x7f5948150618, buf=0x7f5948009e30 "\374\002") at /data/src/10.4/sql/handler.cc:6667
      #20 0x00005584cd412643 in write_record (thd=0x7f594c000b00, table=0x7f59481529a0, info=0x7f59a00b4460) at /data/src/10.4/sql/sql_insert.cc:2024
      #21 0x00005584cd40f99d in mysql_insert (thd=0x7f594c000b00, table_list=0x7f594c0141d8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1067
      #22 0x00005584cd45b208 in mysql_execute_command (thd=0x7f594c000b00) at /data/src/10.4/sql/sql_parse.cc:4791
      #23 0x00005584cd466f86 in mysql_parse (thd=0x7f594c000b00, rawbuf=0x7f594c0140e8 "INSERT INTO t2 (id) VALUES (NULL)", length=33, parser_state=0x7f59a00b5180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8157
      #24 0x00005584cd452674 in dispatch_command (command=COM_QUERY, thd=0x7f594c000b00, packet=0x7f594c00a761 "INSERT INTO t2 (id) VALUES (NULL)", packet_length=33, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
      #25 0x00005584cd450e48 in do_command (thd=0x7f594c000b00) at /data/src/10.4/sql/sql_parse.cc:1358
      #26 0x00005584cd5ca9ab in do_handle_one_connection (connect=0x5584d14c3d10) at /data/src/10.4/sql/sql_connect.cc:1399
      #27 0x00005584cd5ca71c in handle_one_connection (arg=0x5584d14c3d10) at /data/src/10.4/sql/sql_connect.cc:1302
      #28 0x00005584cdac13fd in pfs_spawn_thread (arg=0x5584d1509f30) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #29 0x00007f59a745b494 in start_thread (arg=0x7f59a00b6700) at pthread_create.c:333
      #30 0x00007f59a584193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible with a short index.

      Attachments

        Issue Links

          Activity

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.