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

WITH SYSTEM VERSIONING and FOREIGN KEY can insert a corrupted record

    XMLWordPrintable

Details

    Description

      Problem found during RQG testing on
      10.4 f06868e56b1fbefc13ecfd5a3cf9803cc0108ae6 2019-03-08T12:13:53+02:00
       
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
      #5  0x00007fc9feb3837a in __GI_abort () at abort.c:89 
      #6  0x00007fc9feb2eb47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55b5d3dab7d0 "page_validate(buf_block_get_frame(right_block), cursor->index)", file=file@entry=0x55b5d3da9f30 "storage/innobase/btr/btr0btr.cc", line=line@entry=3349, function=function@entry=0x55b5d3daf700 <btr_page_split_and_insert(unsigned long, btr_cur_t*, unsigned long**, mem_block_info_t**, dtuple_t const*, unsigned long, mtr_t*)::__PRETTY_FUNCTION__> "rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*)") at assert.c:92
      #7  0x00007fc9feb2ebf2 in __GI___assert_fail (assertion=0x55b5d3dab7d0 "page_validate(buf_block_get_frame(right_block), cursor->index)", file=0x55b5d3da9f30 "storage/innobase/btr/btr0btr.cc", line=3349, function=0x55b5d3daf700 <btr_page_split_and_insert(unsigned long, btr_cur_t*, unsigned long**, mem_block_info_t**, dtuple_t const*, unsigned long, mtr_t*)::__PRETTY_FUNCTION__> "rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*)") at assert.c:101
      #8  0x000055b5d3654d67 in btr_page_split_and_insert (flags=0, cursor=0x7fc9f4e621d0, offsets=0x7fc9f4e62168, heap=0x7fc9f4e62160, tuple=0x7fc95820adb8, n_ext=0, mtr=0x7fc9f4e625f0) at storage/innobase/btr/btr0btr.cc:3349
      #9  0x000055b5d3677bd0 in btr_cur_pessimistic_insert (flags=0, cursor=0x7fc9f4e621d0, offsets=0x7fc9f4e62168, heap=0x7fc9f4e62160, entry=0x7fc95820adb8, rec=0x7fc9f4e62170, big_rec=0x7fc9f4e62158, n_ext=0, thr=0x7fc95816b1a8, mtr=0x7fc9f4e625f0) at storage/innobase/btr/btr0cur.cc:3723
      #10 0x000055b5d355d420 in row_ins_clust_index_entry_low (flags=0, mode=33, index=0x7fc9501ae008, n_uniq=2, entry=0x7fc95820adb8, n_ext=0, thr=0x7fc95816b1a8, dup_chk_only=false) at storage/innobase/row/row0ins.cc:2777
      #11 0x000055b5d355ed7f in row_ins_clust_index_entry (index=0x7fc9501ae008, entry=0x7fc95820adb8, thr=0x7fc95816b1a8, n_ext=0, dup_chk_only=false) at storage/innobase/row/row0ins.cc:3297
      #12 0x000055b5d355f179 in row_ins_index_entry (index=0x7fc9501ae008, entry=0x7fc95820adb8, thr=0x7fc95816b1a8) at storage/innobase/row/row0ins.cc:3405
      #13 0x000055b5d355f870 in row_ins_index_entry_step (node=0x7fc958107668, thr=0x7fc95816b1a8) at storage/innobase/row/row0ins.cc:3574
      #14 0x000055b5d355fcad in row_ins (node=0x7fc958107668, thr=0x7fc95816b1a8) at storage/innobase/row/row0ins.cc:3717
      #15 0x000055b5d35604ae in row_ins_step (thr=0x7fc95816b1a8) at storage/innobase/row/row0ins.cc:3962
      #16 0x000055b5d3582537 in row_update_vers_insert (thr=0x7fc95816b1a8, node=0x7fc958188428) at storage/innobase/row/row0mysql.cc:2186
      #17 0x000055b5d35826c1 in row_update_cascade_for_mysql (thr=0x7fc95816b1a8, node=0x7fc958188428, table=0x7fc95009e3b8) at storage/innobase/row/row0mysql.cc:2241
      #18 0x000055b5d3559ec9 in row_ins_foreign_check_on_constraint (thr=0x7fc95816b1a8, foreign=0x7fc9500ad028, pcur=0x7fc9f4e63520, entry=0x7fc9582c17e8, mtr=0x7fc9f4e63980) at storage/innobase/row/row0ins.cc:1446
      #19 0x000055b5d355ad4d in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7fc9500ad028, table=0x7fc9580f29a8, entry=0x7fc9582c17e8, thr=0x7fc95816b1a8) at storage/innobase/row/row0ins.cc:1834
      #20 0x000055b5d35cbf5f in row_upd_check_references_constraints (node=0x7fc958264f98, pcur=0x7fc9f4e64010, table=0x7fc9580f29a8, index=0x7fc95819d298, offsets=0x7fc958246e40, thr=0x7fc95816b1a8, mtr=0x7fc9f4e64590) at storage/innobase/row/row0upd.cc:297
      #21 0x000055b5d35d11df in row_upd_sec_index_entry (node=0x7fc958264f98, thr=0x7fc95816b1a8) at storage/innobase/row/row0upd.cc:2496
      #22 0x000055b5d35d14b3 in row_upd_sec_step (node=0x7fc958264f98, thr=0x7fc95816b1a8) at storage/innobase/row/row0upd.cc:2543
      #23 0x000055b5d35d3f0b in row_upd (node=0x7fc958264f98, thr=0x7fc95816b1a8) at storage/innobase/row/row0upd.cc:3322
      #24 0x000055b5d35d4272 in row_upd_step (thr=0x7fc95816b1a8) at storage/innobase/row/row0upd.cc:3437
      #25 0x000055b5d35819ce in row_update_for_mysql (prebuilt=0x7fc958255cb8) at storage/innobase/row/row0mysql.cc:1890
      #26 0x000055b5d3419aa2 in ha_innobase::delete_row (this=0x7fc958122480, record=0x7fc9581e0ae8 "\004\020\245\n") at storage/innobase/handler/ha_innodb.cc:9025
      #27 0x000055b5d31faf96 in handler::ha_delete_row (this=0x7fc958122480, buf=0x7fc9581e0ae8 "\004\020\245\n") at sql/handler.cc:6810
      #28 0x000055b5d2e5f3c2 in write_record (thd=0x7fc958000a98, table=0x7fc958159658, info=0x7fc9f4e65060) at sql/sql_insert.cc:1972
      #29 0x000055b5d2e94ce1 in read_sep_field (thd=0x7fc958000a98, info=..., table_list=0x7fc9580134f8, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=false) at sql/sql_load.cc:1157
      #30 0x000055b5d2e932f8 in mysql_load (thd=0x7fc958000a98, ex=0x7fc958013470, table_list=0x7fc9580134f8, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_REPLACE, ignore=false, read_file_from_client=false) at sql/sql_load.cc:667
      #31 0x000055b5d2eaa37c in mysql_execute_command (thd=0x7fc958000a98) at sql/sql_parse.cc:5232
      #32 0x000055b5d2eb480f in mysql_parse (thd=0x7fc958000a98, rawbuf=0x7fc958013330 "LOAD DATA INFILE 'load_view_A' REPLACE INTO TABLE view_A /* E_R Thread3 QNO 3282 CON_ID 169 */", length=94, parser_state=0x7fc9f4e661d0, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8204
      #33 0x000055b5d2e9fb37 in dispatch_command (command=COM_QUERY, thd=0x7fc958000a98, packet=0x7fc9581bbbe9 " LOAD DATA INFILE 'load_view_A' REPLACE INTO TABLE view_A /* E_R Thread3 QNO 3282 CON_ID 169 */ ", packet_length=96, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1829
      #34 0x000055b5d2e9e2f7 in do_command (thd=0x7fc958000a98) at sql/sql_parse.cc:1358
      #35 0x000055b5d3016f1d in do_handle_one_connection (connect=0x55b5d7a6ace8) at sql/sql_connect.cc:1399
       
      perl rqg.pl \                         
      --views \
      --grammar=conf/partitioning/partitions.yy \
      --redefine=conf/mariadb/alter_table.yy \
      --redefine=conf/mariadb/instant_add.yy \
      --redefine=conf/mariadb/modules/alter_table_columns.yy \
      --redefine=conf/mariadb/sp.yy \
      --redefine=conf/mariadb/bulk_insert.yy \
      --redefine=conf/mariadb/modules/userstat.yy \
      --redefine=conf/mariadb/modules/foreign_keys.yy \
      --redefine=conf/mariadb/modules/locks.yy \
      --redefine=conf/mariadb/modules/sql_mode.yy \
      --redefine=conf/mariadb/versioning.yy \
      --redefine=conf/mariadb/sequences.yy \
      --redefine=conf/mariadb/modules/locks-10.4-extra.yy \
      --mysqld=--innodb_lock_schedule_algorithm=fcfs \
      --mysqld=--innodb_stats_persistent=off \
      --mysqld=--innodb_adaptive_hash_index=OFF \
      --mysqld=--loose-idle_write_transaction_timeout=0 \
      --mysqld=--loose-idle_transaction_timeout=0 \
      --mysqld=--loose-idle_readonly_transaction_timeout=0 \
      --mysqld=--connect_timeout=60 \
      --mysqld=--interactive_timeout=28800 \
      --mysqld=--slave_net_timeout=60 \
      --mysqld=--net_read_timeout=30 \ 
      --mysqld=--net_write_timeout=60 \
      --mysqld=--loose-table_lock_wait_timeout=50 \
      --mysqld=--wait_timeout=28800 \
      --mysqld=--lock-wait-timeout=86400 \
      --mysqld=--innodb-lock-wait-timeout=50 \
      --mysqld=--innodb_use_native_aio=0 \
      --no-mask \
      --queries=10000000 \
      --duration=300 \
      --seed=random \
      --reporters=Backtrace,ErrorLog,None \
      --validators=None \
      --sqltrace=MarkErrors \
      --mysqld=--log_output=none \
      --mysqld=--log-bin \
      --mysqld=--log_bin_trust_function_creators=1 \
      --mysqld=--loose-max-statement-time=30 \
      --mysqld=--loose-debug_assert_on_not_freed_memory=0 \
      --engine=InnoDB \
      --mysqld=--innodb-buffer-pool-size=256M \
      --whitelist_statuses='STATUS_SERVER_CRASHED' \
      --whitelist_patterns='<signal handler called>','SUMMARY: AddressSanitizer:' \
      --blacklist_statuses='STATUS_OK' \
      --blacklist_patterns='Sentence is now longer than .{1,10} symbols. Possible endless loop in grammar. Aborting.','\[ERROR\] InnoDB: preallocating .{1,120} with error 28',' is truncated: expected core file size ',' is not a core dump: File truncated','mysqld: .{1,100}handler0alter.cc:.{1,20} bool prepare_inplace_alter_table_dict.{1,200} Assertion .ha_alter_info->key_count .{1,500} == ctx->num_to_add_index. failed.','mysqld: .{1,100}fts0fts.cc:.{1,20} ulint fts_init_recover_doc.{1,30}Assertion .cache. failed','mysqld: .{1,150}btr0btr.cc:.{1,30} void btr_set_instant.{1,200} Assertion .supremum.{1,10} == index.n_core_null_bytes. failed.' \
      --threads=8 \
      --workdir=<testing box specific> \
      --vardir=/<testing box specific> \
      --mtr-build-thread=1018 \
      --basedir1=<testing box specific> \
      


      UPDATE: See MTR test case in the comment.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              mleich Matthias Leich
              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.