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

Assertion on evaluating foreign referential action for self-reference in system versioned table

    XMLWordPrintable

Details

    Description

      Assertion `mode == 16 || mode == 12 || !fix_block->page.file_page_was_freed' failed in buf_page_get_low

      It looks like all previous bugs with this assertion failure are closed at the moment.

      I'm not sure whether the problem is really versioning-specific, but I couldn't get rid of versioning in the test case.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (
          pk INT PRIMARY KEY,
          f1 INT,
          f2 INT,
          f3 TEXT,
          KEY(f1),
          FULLTEXT(f3),
          KEY(f3(10)),
          FOREIGN KEY (f2) REFERENCES t1 (f1) ON DELETE SET NULL
      ) ENGINE=InnoDB WITH SYSTEM VERSIONING;
      INSERT INTO t1 VALUES (1,8,8,'a'), (2,8,8,REPEAT('b',8071));
       
      --error ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO
      DELETE FROM t1;
      SELECT * FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 caa35f8e

      2020-09-01 16:55:52 9 [ERROR] InnoDB: Duplicate FTS_DOC_ID value on table `test`.`t1`
      mysqld: /data/src/10.3/storage/innobase/buf/buf0buf.cc:4879: buf_block_t* buf_page_get_low(page_id_t, const page_size_t&, ulint, buf_block_t*, ulint, const char*, unsigned int, mtr_t*, dberr_t*): Assertion `mode == 16 || mode == 12 || !fix_block->page.file_page_was_freed' failed.
      200901 16:55:52 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f6329c77f12 in __GI___assert_fail (assertion=0x55fd98b16df8 "mode == 16 || mode == 12 || !fix_block->page.file_page_was_freed", file=0x55fd98b14d18 "/data/src/10.3/storage/innobase/buf/buf0buf.cc", line=4879, function=0x55fd98b1aae0 <buf_page_get_low(page_id_t, page_size_t const&, unsigned long, buf_block_t*, unsigned long, char const*, unsigned int, mtr_t*, dberr_t*)::__PRETTY_FUNCTION__> "buf_block_t* buf_page_get_low(page_id_t, const page_size_t&, ulint, buf_block_t*, ulint, const char*, unsigned int, mtr_t*, dberr_t*)") at assert.c:101
      #8  0x000055fd98437bc9 in buf_page_get_low (page_id=..., page_size=..., rw_latch=1, guess=0x0, mode=10, file=0x55fd98affa80 "/data/src/10.3/storage/innobase/btr/btr0cur.cc", line=7991, mtr=0x7f6324073d70, err=0x0) at /data/src/10.3/storage/innobase/buf/buf0buf.cc:4879
      #9  0x000055fd9843802b in buf_page_get_gen (page_id=..., page_size=..., rw_latch=1, guess=0x0, mode=10, file=0x55fd98affa80 "/data/src/10.3/storage/innobase/btr/btr0cur.cc", line=7991, mtr=0x7f6324073d70, err=0x0) at /data/src/10.3/storage/innobase/buf/buf0buf.cc:4974
      #10 0x000055fd984017cd in btr_copy_blob_prefix (buf=0x7f62d0049670 "a", '\217' <repeats 199 times>..., len=8071, space_id=5, page_no=8, offset=38) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:7991
      #11 0x000055fd984022dc in btr_copy_externally_stored_field_prefix_low (buf=0x7f62d0049670 "a", '\217' <repeats 199 times>..., len=8071, page_size=..., space_id=5, page_no=8, offset=38) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:8201
      #12 0x000055fd98402571 in btr_copy_externally_stored_field (len=0x7f6324074390, data=0x7f631f4e40d7 "", page_size=..., local_len=0, heap=0x7f62d00495f0) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:8307
      #13 0x000055fd98402691 in btr_rec_copy_externally_stored_field (rec=0x7f631f4e40b7 "\200", offsets=0x7f6324074610, page_size=..., no=6, len=0x7f6324074390, heap=0x7f62d00495f0) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:8363
      #14 0x000055fd98305828 in row_sel_store_mysql_field (mysql_rec=0x7f62d00082a0 "\370\002", prebuilt=0x7f62d0040f00, rec=0x7f631f4e40b7 "\200", index=0x7f62d00a5a30, offsets=0x7f6324074610, field_no=6, templ=0x7f62d000a730) at /data/src/10.3/storage/innobase/row/row0sel.cc:2959
      #15 0x000055fd98306295 in row_sel_store_mysql_rec (mysql_rec=0x7f62d00082a0 "\370\002", prebuilt=0x7f62d0040f00, rec=0x7f631f4e40b7 "\200", vrow=0x0, rec_clust=false, index=0x7f62d00a5a30, offsets=0x7f6324074610) at /data/src/10.3/storage/innobase/row/row0sel.cc:3168
      #16 0x000055fd9830cad6 in row_search_mvcc (buf=0x7f62d00082a0 "\370\002", mode=PAGE_CUR_G, prebuilt=0x7f62d0040f00, match_mode=0, direction=1) at /data/src/10.3/storage/innobase/row/row0sel.cc:5486
      #17 0x000055fd98129bb8 in ha_innobase::general_fetch (this=0x7f62d000c248, buf=0x7f62d00082a0 "\370\002", direction=1, match_mode=0) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9502
      #18 0x000055fd9812a13c in ha_innobase::rnd_next (this=0x7f62d000c248, buf=0x7f62d00082a0 "\370\002") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9711
      #19 0x000055fd97efa764 in handler::ha_rnd_next (this=0x7f62d000c248, buf=0x7f62d00082a0 "\370\002") at /data/src/10.3/sql/handler.cc:2847
      #20 0x000055fd9808c56b in rr_sequential (info=0x7f62d0015760) at /data/src/10.3/sql/records.cc:485
      #21 0x000055fd97b378fd in READ_RECORD::read_record (this=0x7f62d0015760) at /data/src/10.3/sql/records.h:70
      #22 0x000055fd97c518e8 in sub_select (join=0x7f62d0013160, join_tab=0x7f62d0015698, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19733
      #23 0x000055fd97c50d03 in do_select (join=0x7f62d0013160, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:19254
      #24 0x000055fd97c27c29 in JOIN::exec_inner (this=0x7f62d0013160) at /data/src/10.3/sql/sql_select.cc:4116
      #25 0x000055fd97c26ffc in JOIN::exec (this=0x7f62d0013160) at /data/src/10.3/sql/sql_select.cc:3910
      #26 0x000055fd97c2830d in mysql_select (thd=0x7f62d0000af0, tables=0x7f62d0012a08, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f62d0013138, unit=0x7f62d00049b8, select_lex=0x7f62d0005140) at /data/src/10.3/sql/sql_select.cc:4315
      #27 0x000055fd97c198e2 in handle_select (thd=0x7f62d0000af0, lex=0x7f62d00048f8, result=0x7f62d0013138, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
      #28 0x000055fd97be11fc in execute_sqlcom_select (thd=0x7f62d0000af0, all_tables=0x7f62d0012a08) at /data/src/10.3/sql/sql_parse.cc:6286
      #29 0x000055fd97bd794f in mysql_execute_command (thd=0x7f62d0000af0) at /data/src/10.3/sql/sql_parse.cc:3812
      #30 0x000055fd97be5507 in mysql_parse (thd=0x7f62d0000af0, rawbuf=0x7f62d0012818 "SELECT * FROM t1", length=16, parser_state=0x7f63240765e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7810
      #31 0x000055fd97bd1d4e in dispatch_command (command=COM_QUERY, thd=0x7f62d0000af0, packet=0x7f62d0165811 "", packet_length=16, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1848
      #32 0x000055fd97bd0666 in do_command (thd=0x7f62d0000af0) at /data/src/10.3/sql/sql_parse.cc:1393
      #33 0x000055fd97d49f57 in do_handle_one_connection (connect=0x55fd9a59be80) at /data/src/10.3/sql/sql_connect.cc:1403
      #34 0x000055fd97d49cb9 in handle_one_connection (arg=0x55fd9a59be80) at /data/src/10.3/sql/sql_connect.cc:1308
      #35 0x000055fd98701e60 in pfs_spawn_thread (arg=0x55fd9a5b6e30) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #36 0x00007f632bc004a4 in start_thread (arg=0x7f6324077700) at pthread_create.c:456
      #37 0x00007f6329d34d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.3+.
      The test case is not applicable to earlier versions due to system versioning.

      Non-debug builds produce the same ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO upon DELETE (I'm not sure whether it's legit), but no crash.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.