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

Assertion `index->id == btr_page_get_index_id(page)' failed in btr_cur_search_to_nth_level

    Details

      Description

      Note: The test is exactly the same as in MDEV-13205, but the assertion failure is different on 10.2, so I'm filing it separately just in case.

      Run the test with repeat=N. So far repeat=5 has always been enough for me.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (c VARCHAR(64)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES  ('foo'),('bar');
       
      CREATE TABLE t2 ENGINE = InnoDB AS SELECT * FROM t1;
      CREATE TABLE t3 ENGINE = InnoDB AS SELECT * FROM t1;
       
      --send
      ALTER TABLE t2 ADD UNIQUE (c);
      --connect (con2,127.0.0.1,root,,test)
      --error 0,ER_DUP_ENTRY
      INSERT INTO t2 SELECT * FROM t1;
      ALTER TABLE t3 ADD FOREIGN KEY (c) REFERENCES t2 (c);
       
      # Cleanup
      --disconnect con2
      --connection default
      --error 0,ER_DUP_ENTRY
      --reap
      DROP TABLE t3, t2, t1;
      

      10.2 23edc7c88f29d7bee01f39f1a58f4ada05f724c3

      mysqld: /data/src/10.2/storage/innobase/btr/btr0cur.cc:1309: dberr_t btr_cur_search_to_nth_level(dict_index_t*, ulint, const dtuple_t*, page_cur_mode_t, ulint, btr_cur_t*, ulint, const char*, unsigned int, mtr_t*, ib_uint64_t): Assertion `index->id == btr_page_get_index_id(page)' failed.
      170629  3:44:34 [ERROR] mysqld got signal 6 ;
      

      #7  0x00007fadb57afee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000559d383932ea in btr_cur_search_to_nth_level (index=0x7fad6004af58, level=0, tuple=0x7fad54021520, mode=PAGE_CUR_GE, latch_mode=1, cursor=0x7fada838a5b0, has_search_latch=0, file=0x559d387de8a8 "/data/src/10.2/storage/innobase/row/row0ins.cc", line=1714, mtr=0x7fada838a9d0, autoinc=0) at /data/src/10.2/storage/innobase/btr/btr0cur.cc:1309
      #9  0x0000559d3826dea1 in btr_pcur_open_low (index=0x7fad6004af58, level=0, tuple=0x7fad54021520, mode=PAGE_CUR_GE, latch_mode=1, cursor=0x7fada838a5b0, file=0x559d387de8a8 "/data/src/10.2/storage/innobase/row/row0ins.cc", line=1714, autoinc=0, mtr=0x7fada838a9d0) at /data/src/10.2/storage/innobase/include/btr0pcur.ic:459
      #10 0x0000559d38272224 in row_ins_check_foreign_constraint (check_ref=1, foreign=0x7fad54022ce8, table=0x7fad5401f1f8, entry=0x7fad54021520, thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:1714
      #11 0x0000559d38272a61 in row_ins_check_foreign_constraints (table=0x7fad5401f1f8, index=0x7fad540232d8, entry=0x7fad54021520, thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:1984
      #12 0x0000559d38275c4d in row_ins_sec_index_entry (index=0x7fad540232d8, entry=0x7fad54021520, thr=0x7fad54024470, dup_chk_only=false) at /data/src/10.2/storage/innobase/row/row0ins.cc:3245
      #13 0x0000559d38275e78 in row_ins_index_entry (index=0x7fad540232d8, entry=0x7fad54021520, thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:3307
      #14 0x0000559d38276369 in row_ins_index_entry_step (node=0x7fad540241d8, thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:3455
      #15 0x0000559d3827671e in row_ins (node=0x7fad540241d8, thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:3597
      #16 0x0000559d38276d1a in row_ins_step (thr=0x7fad54024470) at /data/src/10.2/storage/innobase/row/row0ins.cc:3781
      #17 0x0000559d38293fc0 in row_insert_for_mysql (mysql_rec=0x7fad5401ec38 "\376\003foo", prebuilt=0x7fad54023cb8) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1486
      #18 0x0000559d38157505 in ha_innobase::write_row (this=0x7fad5401e448, record=0x7fad5401ec38 "\376\003foo") at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:8663
      #19 0x0000559d37e51721 in handler::ha_write_row (this=0x7fad5401e448, buf=0x7fad5401ec38 "\376\003foo") at /data/src/10.2/sql/handler.cc:5950
      #20 0x0000559d37cab396 in copy_data_between_tables (thd=0x7fad54000b00, from=0x7fad6003b590, to=0x7fad5401d840, create=..., ignore=false, order_num=0, order=0x0, copied=0x7fada838c598, deleted=0x7fada838c5a0, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fada838d260) at /data/src/10.2/sql/sql_table.cc:9873
      #21 0x0000559d37ca9a13 in mysql_alter_table (thd=0x7fad54000b00, new_db=0x7fad54011760 "test", new_name=0x0, create_info=0x7fada838de70, table_list=0x7fad54011150, alter_info=0x7fada838ddc0, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9375
      #22 0x0000559d37d2187a in Sql_cmd_alter_table::execute (this=0x7fad54011960, thd=0x7fad54000b00) at /data/src/10.2/sql/sql_alter.cc:324
      #23 0x0000559d37bdfb84 in mysql_execute_command (thd=0x7fad54000b00) at /data/src/10.2/sql/sql_parse.cc:6211
      #24 0x0000559d37be4444 in mysql_parse (thd=0x7fad54000b00, rawbuf=0x7fad54011038 "ALTER TABLE t3 ADD FOREIGN KEY (c) REFERENCES t2 (c)", length=52, parser_state=0x7fada838f200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #25 0x0000559d37bd24f1 in dispatch_command (command=COM_QUERY, thd=0x7fad54000b00, packet=0x7fad540087c1 "ALTER TABLE t3 ADD FOREIGN KEY (c) REFERENCES t2 (c)", packet_length=52, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #26 0x0000559d37bd0e32 in do_command (thd=0x7fad54000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #27 0x0000559d37d1c57d in do_handle_one_connection (connect=0x559d3a8dc690) at /data/src/10.2/sql/sql_connect.cc:1354
      #28 0x0000559d37d1c30a in handle_one_connection (arg=0x559d3a8dc690) at /data/src/10.2/sql/sql_connect.cc:1260
      #29 0x0000559d38136f8a in pfs_spawn_thread (arg=0x559d3a83ff20) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #30 0x00007fadb76f4494 in start_thread (arg=0x7fada8390700) at pthread_create.c:333
      #31 0x00007fadb586c93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: