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

InnoDB: Failing assertion: !cursor->index->is_committed in row_ins_sec_index_entry_by_modify

    XMLWordPrintable

Details

    Description

      Note: The test case is closely related to MDEV-18879, possibly the problem itself is too.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (
        pk int,
        f1 longtext,
        f2 enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f3 enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f4 varchar(255) CHARACTER SET ucs2,
        f5 longtext CHARACTER SET ucs2,
        f6 varchar(255) CHARACTER SET utf8,
        f7 char(255) CHARACTER SET utf8,
        f8 longtext CHARACTER SET ucs2,
        f9 set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f10 enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f11 enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f12 set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f13 set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f14 set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
        f15 varchar(255) CHARACTER SET ucs2,
        f16 char(255) CHARACTER SET ucs2,
        f17 char(255) CHARACTER SET ucs2,
        f18 varchar(255) CHARACTER SET utf8,
        f19 longtext CHARACTER SET utf8,
        f20 char(255) CHARACTER SET utf8,
        primary key (pk)
      ) ENGINE=InnoDB WITH SYSTEM VERSIONING;
       
      INSERT INTO t1 VALUES
        (1, 'rat', 's', 'q', 'f', 'e', 'f', 'y', 'generate', 'x', 'w', 'l', 's', 'z', 'g', 'main', 'against', 'w', 'u', 'explode', 'tomorrow'),
        (2, 'franchise', 'q', 'w', 'r', 't', 'b', 'modern', 'h', 'r', NULL, 'g', 'd', 'm', 'h', 'g', 'a', 'w', 'f', 'b', 'b'),
        (3, 'q', 'r', 'c', 'through', 'k', 'thread', 'cover', 'long', 't', 's', 'u', 'v', 'd', 'w', 'r', 's', 'severe', 'z', 'v', 'd'),
        (4, 'proud', 'y', 's', 'g', 'h', 'a', 'w', 'indicator', 's', 'j', 'o', 'a', 't', 'm', 'bone', 'debt', 'normally', 'campus', 'z', 'b'),
        (5, 'death', 'e', 'f', 'relative', 'f', 'publicity', 'q', 'x', 'e', 'd', 'w', 'w', 'o', 's', 'w', 'k', 'y', 'h', 'hero', 'e'),
        (6, 'w', 'y', NULL, 'l', 'merely', 'advanced', 'v', 'captain', 's', 'o', 't', 'c', 'd', 'd', 'eliminate', 'w', 'coordinator', 'singer', 'v', 'c'),
        (7, 'reflect', 'o', 'n', 'informal', 'y', 'f', 'assignment', 'giant', 'a', 'd', 'q', 'v', 'f', 's', 'h', 't', 's', REPEAT('v',30), 'e', 'e'),
        (8, 'g', 's', 't', 'enforcement', 'l', 'willing', 'c', 'theater', 'a', 'a', 'o', 'z', 'z', 'y', 'v', 'h', 'a', 'weed', 't', 'fall'),
        (9, 'ice', NULL, 'i', REPEAT('w',205), 'rose', 'trail', 'm', 'p', 'r', 'r', 's', 's', 'z', 'l', REPEAT('i',67), 'k', 'scope', 's', 'dog', 'r'),
        (10, 't', NULL, NULL, 'rural', 'k', 'stuff', 'b', 'weapon', 'm', 'r', 'o', 'l', 's', 'q', 'e', 'p', 'client', 'beard', 'picture', 'h'),
        (11, 'yeah', 'n', NULL, 'yield', 'often', 'a', 'shopping', 'confusion', 'h', 'k', 'o', 'm', 'w', 'l', 'r', 'r', 'x', REPEAT('f',198), 'major', 'rate'),
        (12, 'a', 'i', NULL, 'k', 'uncomfortable', REPEAT('v',248), 'y', 'link', 'p', 'n', 'k', 'n', 'c', 'z', REPEAT('j',204), 'j', 'statute', 'emphasis', 'u', 'water'),
        (13, 'position', 'l', 'a', 'p', 'x', 'channel', 'k', 'arab', 'a', 'e', 'z', 'p', 'u', 'o', 'blanket', 'some', 'u', 'feel', 'c', 'i'),
        (14, 'b', 'j', 'l', 'g', 'emerge', 'r', 'stuff', 'expense', 'f', 'y', 'e', 'x', 'k', 'm', 'c', 'sensation', 'l', 'bar', 'maintenance', 'f'),
        (15, 'coordinator', 'a', NULL, 'headline', 'g', 'laser', 'z', 'r', 's', 'q', 'g', 'j', 'r', 'd', 'u', 'democrat', 'artificial', 'quote', 'a', 'heaven'),
        (16, 'b', 'd', 'b', 'h', 'apologize', 'direct', 'u', 'frankly', 'g', 'b', 'm', 'p', 'c', 'c', 'h', 'exhibit', 'f', 'd', 'effective', 'c'),
        (17, 'tackle', 'v', 'z', 'i', 'h', 'y', 'y', 'u', 's', 'n', NULL, 's', 't', 'o', 'l', 'k', 'm', 'respond', 'ideological', 'credibility');
       
      CREATE TABLE t2 (
        pk int,
        f char(255) CHARACTER SET ucs2,
        primary key (pk),
        key (f)
      ) ENGINE=innodb;
       
      INSERT INTO t2 VALUES (1,'r'),(2,'k');
       
      SET SQL_MODE= '';
      SELECT * FROM t1 INTO OUTFILE 't1.data';
      UPDATE t1 SET f16 = 'foo';
      LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
      SELECT * FROM t1 INTO OUTFILE 't1.data.2';
      LOAD DATA INFILE 't1.data.2' REPLACE INTO TABLE t1;
      SET FOREIGN_KEY_CHECKS = OFF;
      SELECT * FROM t2 INTO OUTFILE 't2.data';
      LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2;
      ALTER TABLE t1 ADD FOREIGN KEY (f16) REFERENCES t2 (f) ON DELETE SET NULL;
      LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
      UPDATE t1 SET f17 = 'foo';
      SET FOREIGN_KEY_CHECKS = ON;
      SET SESSION SQL_MODE= 'NO_BACKSLASH_ESCAPES';
      LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
      REPLACE INTO t2 SELECT * FROM t2;
       
      # Cleanup
      DROP TABLE t1, t2;
      --let $datadir= `select @@datadir`
      --remove_file $datadir/test/t1.data
      --remove_file $datadir/test/t1.data.2
      --remove_file $datadir/test/t2.data
      

      10.3 117291db

      2019-03-20 02:15:41 0x7f034c0af700  InnoDB: Assertion failure in file /data/src/10.3/storage/innobase/row/row0ins.cc line 270
      InnoDB: Failing assertion: !cursor->index->is_committed()
       
      #5  0x00007f03525113fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
      #6  0x0000560411f8026b in ut_dbg_assertion_failed (expr=0x560412506408 "!cursor->index->is_committed()", file=0x5604125062c0 "/data/src/10.3/storage/innobase/row/row0ins.cc", line=270) at /data/src/10.3/storage/innobase/ut/ut0dbg.cc:60
      #7  0x0000560411e874cc in row_ins_sec_index_entry_by_modify (flags=0, mode=2, cursor=0x7f034c0aa0b0, offsets=0x7f034c0aa050, offsets_heap=0x7f02f804ed40, heap=0x7f02f804f1d0, entry=0x7f02f804e6e8, thr=0x7f02f805d878, mtr=0x7f034c0aabc0) at /data/src/10.3/storage/innobase/row/row0ins.cc:270
      #8  0x0000560411e8ed84 in row_ins_sec_index_entry_low (flags=0, mode=2, index=0x7f02f80494c8, offsets_heap=0x7f02f804ed40, heap=0x7f02f804f1d0, entry=0x7f02f804e6e8, trx_id=0, thr=0x7f02f805d878, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:3161
      #9  0x0000560411e8f5cb in row_ins_sec_index_entry (index=0x7f02f80494c8, entry=0x7f02f804e6e8, thr=0x7f02f805d878, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:3362
      #10 0x0000560411e8f79f in row_ins_index_entry (index=0x7f02f80494c8, entry=0x7f02f804e6e8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0ins.cc:3408
      #11 0x0000560411e8fd46 in row_ins_index_entry_step (node=0x7f02f804dfd8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0ins.cc:3556
      #12 0x0000560411e90180 in row_ins (node=0x7f02f804dfd8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0ins.cc:3699
      #13 0x0000560411e90985 in row_ins_step (thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0ins.cc:3944
      #14 0x0000560411eb2f06 in row_update_vers_insert (thr=0x7f02f805d878, node=0x7f02f803fdb8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:2185
      age/innobase/row/row0ins.cc:1850
      #18 0x0000560411f08099 in row_upd_check_references_constraints (node=0x7f02f8090dd8, pcur=0x7f034c0ac160, table=0x7f02f8183a38, index=0x7f02f80a8388, offsets=0x7f02f8040d00, thr=0x7f02f805d878, mtr=0x7f034c0ac680) at /data/src/10.3/storage/innobase/row/row0upd.cc:297
      #19 0x0000560411f0d0cc in row_upd_sec_index_entry (node=0x7f02f8090dd8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0upd.cc:2516
      #20 0x0000560411f0d39b in row_upd_sec_step (node=0x7f02f8090dd8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0upd.cc:2563
      #21 0x0000560411f0fb8a in row_upd (node=0x7f02f8090dd8, thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0upd.cc:3331
      #22 0x0000560411f0fef2 in row_upd_step (thr=0x7f02f805d878) at /data/src/10.3/storage/innobase/row/row0upd.cc:3446
      #23 0x0000560411eb239e in row_update_for_mysql (prebuilt=0x7f02f80900f8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:1889
      #24 0x0000560411d5b649 in ha_innobase::delete_row (this=0x7f02f8182a68, record=0x7f02f8183410 "\245\001") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9012
      #25 0x0000560411a43c64 in handler::ha_delete_row (this=0x7f02f8182a68, buf=0x7f02f8183410 "\245\001") at /data/src/10.3/sql/handler.cc:6407
      #26 0x00005604116fd829 in write_record (thd=0x7f02f8000b00, table=0x7f02f8181e20, info=0x7f02f8016450) at /data/src/10.3/sql/sql_insert.cc:1968
      #27 0x0000560411702d62 in select_insert::send_data (this=0x7f02f8016408, values=...) at /data/src/10.3/sql/sql_insert.cc:3851
      #28 0x00005604117b1532 in end_send (join=0x7f02f80164b8, join_tab=0x7f02f8018008, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:20580
      #29 0x00005604117aed42 in evaluate_join_record (join=0x7f02f80164b8, join_tab=0x7f02f8017c58, error=0) at /data/src/10.3/sql/sql_select.cc:19616
      #30 0x00005604117c3d5a in AGGR_OP::end_send (this=0x7f02f8018558) at /data/src/10.3/sql/sql_select.cc:27448
      #31 0x00005604117ae0cd in sub_select_postjoin_aggr (join=0x7f02f80164b8, join_tab=0x7f02f8017c58, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19112
      #32 0x00005604117ae3fa in sub_select (join=0x7f02f80164b8, join_tab=0x7f02f80178a8, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19347
      #33 0x00005604117adbc2 in do_select (join=0x7f02f80164b8, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18938
      #34 0x0000560411786735 in JOIN::exec_inner (this=0x7f02f80164b8) at /data/src/10.3/sql/sql_select.cc:4040
      #35 0x0000560411785b76 in JOIN::exec (this=0x7f02f80164b8) at /data/src/10.3/sql/sql_select.cc:3834
      #36 0x0000560411786e16 in mysql_select (thd=0x7f02f8000b00, tables=0x7f02f8015580, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7f02f8016408, unit=0x7f02f80049c8, select_lex=0x7f02f8005138) at /data/src/10.3/sql/sql_select.cc:4239
      #37 0x0000560411778d36 in handle_select (thd=0x7f02f8000b00, lex=0x7f02f8004900, result=0x7f02f8016408, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:385
      #38 0x000056041173d104 in mysql_execute_command (thd=0x7f02f8000b00) at /data/src/10.3/sql/sql_parse.cc:4836
      #39 0x00005604117476bc in mysql_parse (thd=0x7f02f8000b00, rawbuf=0x7f02f8014ce8 "REPLACE INTO t2 SELECT * FROM t2", length=32, parser_state=0x7f034c0ae5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
      #40 0x0000560411734970 in dispatch_command (command=COM_QUERY, thd=0x7f02f8000b00, packet=0x7f02f8162271 "REPLACE INTO t2 SELECT * FROM t2", packet_length=32, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #41 0x000056041173335a in do_command (thd=0x7f02f8000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #42 0x000056041189be51 in do_handle_one_connection (connect=0x5604152cf080) at /data/src/10.3/sql/sql_connect.cc:1402
      #43 0x000056041189bbd5 in handle_one_connection (arg=0x5604152cf080) at /data/src/10.3/sql/sql_connect.cc:1308
      #44 0x0000560411d38597 in pfs_spawn_thread (arg=0x560415214420) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #45 0x00007f03543f7494 in start_thread (arg=0x7f034c0af700) at pthread_create.c:333
      #46 0x00007f03525c593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          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.