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

WITH SYSTEM VERSIONING and FOREIGN KEY can insert a corrupted record

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

            mleich Matthias Leich created issue -
            mleich Matthias Leich made changes -
            Field Original Value New Value
            Summary rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(right_block), cursor->index)' failed in btr0btr.cc Draft: rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(right_block), cursor->index)' failed in btr0btr.cc

            The problem is in the moment not good reproducible.
            I will try to simplify the RQG grammar.
            

            mleich Matthias Leich added a comment - The problem is in the moment not good reproducible. I will try to simplify the RQG grammar.
            mleich Matthias Leich made changes -
            Attachment MDEV-18879_log.tgz [ 47703 ]
            elenst Elena Stepanova made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]

            Test case:

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (
              pk int,
              f1 varchar(255)  CHARACTER SET ucs2,
              f2 longtext CHARACTER SET ucs2,
              f3 varchar(255),
              f4 char(255),
              f5 longtext CHARACTER SET ucs2,
              f6 INT,
              f7 INT,
              f8 INT,
              f9 INT,
              f10 INT,
              f11 INT,
              f12 varchar(255) CHARACTER SET ucs2,
              f13 char(255)  CHARACTER SET ucs2,
              f14 char(255) CHARACTER SET ucs2,
              f15 varchar(255),
              f16 longtext,
              f17 char(255),
              primary key (pk)
            ) ENGINE=InnoDB WITH SYSTEM VERSIONING;
             
            INSERT INTO t1 VALUES  
            (1, 'a', 'e', 'f', 'a', 'generate', 1, 2, 3, 4, 5, 6, 'main', 'against', 'b', 'u', 'explode', 'tomorrow'),
            (2, REPEAT('a',127), 'f', 'k', 'game', 'g', 2, 3, 4, 5, 6, 7, REPEAT('o',222), 'oven', 'flower', REPEAT('r',120), 'l', 'g'),
            (3, 'weekly', 'x', 'v', 'r', 'c', 3, 4, 5, 6, 7, 8, 'validity', 'y', 'h', 'oxygen', 'venture', 'uncertainty'),
            (4, 'r', 't', REPEAT('b',153), 'modern', 'h', 4, 5, 6, 7, 8, 9, REPEAT('g',128), 'a', 'w', 'f', 'b', 'b'),
            (5, 'h', 'y', REPEAT('v',107), 'knife', 'profession', 5, 6, 7, 8, 9, 0, 'infection', 'u', 'likelihood', REPEAT('n',149), 'folk', 'd'),
            (6, 'g', 'violent', REPEAT('o',28), 'capital', 'p', 6, 7, 8, 9, 0, 1, 'w', 'patron', 'd', 'y', 'originally', 'k'),
            (7, 'k', 'uncomfortable', REPEAT('v',248), 'y', 'link', 7, 8, 9, 0, 1, 2, REPEAT('j',204), 'j', 'statute', 'emphasis', 'u', 'water'),
            (8, 'preparation', 'water', 'suck', 'silver', 'a', 8, 9, 0, 1, 2, 3, 'h', 'q', 'o', 't', 'k', 'y'),
            (9, 'y', 'f', 'e', 'a', 'dawn', 9, 0, 1, 2, 3, 4, 'peak', 'parking', 'b', 't', 'timber', 'c'),
            (10, REPEAT('h',78), 'apologize', 'direct', 'u', 'frankly', 0, 1, 2, 3, 4, 5, 'h', 'exhibit', 'f', 'd', 'effective', 'c'),
            (11, 'i', 'h', 'a', 'y', 'u', 1, 2, 3, 4, 5, 6, 'l', 'b', '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,'against'),(2,'q');
             
            SET SQL_MODE= '';
            SELECT * FROM t1 INTO OUTFILE 't1.data';
            UPDATE t1 SET f13 = 'q';
            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;
            SELECT * FROM t2 INTO OUTFILE 't2.data';
            LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2;
            SET FOREIGN_KEY_CHECKS = OFF;
            ALTER TABLE t1 ADD FOREIGN KEY (f13) REFERENCES t2 (f) ON DELETE SET NULL;
            LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1;
            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 51e48b9f

            2019-03-20  0:34:32 9 [ERROR] InnoDB: Records in wrong order on space 5 page 11 index `PRIMARY`
             
            InnoDB: previous record PHYSICAL RECORD: n_fields 22; compact format; info bits 0
             0: len 4; hex 80000008; asc     ;;
             1: len 7; hex 5c916e780b7982; asc \ nx y ;;
             2: len 6; hex 000000000000; asc       ;;
             3: len 7; hex 80000000000000; asc        ;;
             4: len 30; hex 000000700000007200000065000000700000006100000072000000610000; asc    p   r   e   p   a   r   a  ; (total 44 bytes);
             5: len 20; hex 0000007700000061000000740000006500000072; asc    w   a   t   e   r;;
             6: len 4; hex 7375636b; asc suck;;
             7: len 30; hex 73696c766572202020202020202020202020202020202020202020202020; asc silver                        ; (total 255 bytes);
             8: len 4; hex 00000061; asc    a;;
             9: len 4; hex 80000008; asc     ;;
             10: len 4; hex 80000009; asc     ;;
             11: len 4; hex 80000000; asc     ;;
             12: len 4; hex 80000001; asc     ;;
             13: len 4; hex 80000002; asc     ;;
             14: len 4; hex 80000003; asc     ;;
             15: len 4; hex 00000068; asc    h;;
             16: len 30; hex 000000710020002000200020002000200020002000200020002000200020; asc    q                          ; (total 510 bytes);
             17: len 30; hex 0000006f0020002000200020002000200020002000200020002000200020; asc    o                          ; (total 510 bytes);
             18: len 1; hex 74; asc t;;
             19: len 1; hex 6b; asc k;;
             20: len 30; hex 792020202020202020202020202020202020202020202020202020202020; asc y                             ; (total 255 bytes);
             21: len 7; hex 5c916e780b53e0; asc \ nx S ;;
             
            InnoDB: record PHYSICAL RECORD: n_fields 22; compact format; info bits 0
             0: len 4; hex 20202020; asc     ;;
             1: len 7; hex 5c916e780b9987; asc \ nx   ;;
             2: len 6; hex 00000000003b; asc      ;;;
             3: len 7; hex 8f000001410c69; asc     A i;;
             4: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc                               ; (total 44 bytes);
             5: len 20; hex 2020202020202020202020202020202020202020; asc                     ;;
             6: len 4; hex 20202020; asc     ;;
             7: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc                               ; (total 255 bytes);
             8: len 4; hex 00000000; asc     ;;
             9: len 4; hex 00000000; asc     ;;
             10: len 4; hex 00000000; asc     ;;
             11: len 4; hex 00000000; asc     ;;
             12: len 4; hex 00000000; asc     ;;
             13: len 4; hex 00000000; asc     ;;
             14: len 4; hex 00000000; asc     ;;
             15: len 4; hex 00000000; asc     ;;
             16: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 510 bytes);
             17: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 510 bytes);
             18: len 1; hex 00; asc  ;;
             19: len 1; hex 00; asc  ;;
             20: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 255 bytes);
             21: len 7; hex 00000000000000; asc        ;;
             
            2019-03-20  0:34:32 9 [ERROR] InnoDB: Apparent corruption in space 5 page 11 index `PRIMARY`
            2019-03-20  0:34:32 9 [ERROR] InnoDB: Records in wrong order on space 5 page 11 index `PRIMARY`
             
            InnoDB: previous record PHYSICAL RECORD: n_fields 22; compact format; info bits 0
             0: len 4; hex 80000008; asc     ;;
             1: len 7; hex 5c916e780b7982; asc \ nx y ;;
             2: len 6; hex 000000000000; asc       ;;
             3: len 7; hex 80000000000000; asc        ;;
             4: len 30; hex 000000700000007200000065000000700000006100000072000000610000; asc    p   r   e   p   a   r   a  ; (total 44 bytes);
             5: len 20; hex 0000007700000061000000740000006500000072; asc    w   a   t   e   r;;
             6: len 4; hex 7375636b; asc suck;;
             7: len 30; hex 73696c766572202020202020202020202020202020202020202020202020; asc silver                        ; (total 255 bytes);
             8: len 4; hex 00000061; asc    a;;
             9: len 4; hex 80000008; asc     ;;
             10: len 4; hex 80000009; asc     ;;
             11: len 4; hex 80000000; asc     ;;
             12: len 4; hex 80000001; asc     ;;
             13: len 4; hex 80000002; asc     ;;
             14: len 4; hex 80000003; asc     ;;
             15: len 4; hex 00000068; asc    h;;
             16: len 30; hex 000000710020002000200020002000200020002000200020002000200020; asc    q                          ; (total 510 bytes);
             17: len 30; hex 0000006f0020002000200020002000200020002000200020002000200020; asc    o                          ; (total 510 bytes);
             18: len 1; hex 74; asc t;;
             19: len 1; hex 6b; asc k;;
             20: len 30; hex 792020202020202020202020202020202020202020202020202020202020; asc y                             ; (total 255 bytes);
             21: len 7; hex 5c916e780b53e0; asc \ nx S ;;
             
            InnoDB: record PHYSICAL RECORD: n_fields 22; compact format; info bits 0
             0: len 4; hex 20202020; asc     ;;
             1: len 7; hex 5c916e780b9987; asc \ nx   ;;
             2: len 6; hex 00000000003b; asc      ;;;
             3: len 7; hex 8f000001410c69; asc     A i;;
             4: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc                               ; (total 44 bytes);
             5: len 20; hex 2020202020202020202020202020202020202020; asc                     ;;
             6: len 4; hex 20202020; asc     ;;
             7: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc                               ; (total 255 bytes);
             8: len 4; hex 00000000; asc     ;;
             9: len 4; hex 00000000; asc     ;;
             10: len 4; hex 00000000; asc     ;;
             11: len 4; hex 00000000; asc     ;;
             12: len 4; hex 00000000; asc     ;;
             13: len 4; hex 00000000; asc     ;;
             14: len 4; hex 00000000; asc     ;;
             15: len 4; hex 00000000; asc     ;;
             16: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 510 bytes);
             17: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 510 bytes);
             18: len 1; hex 00; asc  ;;
             19: len 1; hex 00; asc  ;;
             20: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc                               ; (total 255 bytes);
             21: len 7; hex 00000000000000; asc        ;;
            

            2019-03-20  0:34:32 9 [ERROR] InnoDB: Apparent corruption in space 5 page 11 index `PRIMARY`
            mysqld: /data/src/10.3/storage/innobase/btr/btr0btr.cc:3320: rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(left_block), cursor->index)' failed.
            190320  0:34:32 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fbe5e4ceee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x00005572c1dc748e in btr_page_split_and_insert (flags=0, cursor=0x7fbe58070770, offsets=0x7fbe58070708, heap=0x7fbe58070700, tuple=0x7fbe04172e18, n_ext=0, mtr=0x7fbe58070b90) at /data/src/10.3/storage/innobase/btr/btr0btr.cc:3320
            #11 0x00005572c1cc370d in row_ins_clust_index_entry (index=0x7fbe041756a8, entry=0x7fbe04172e18, thr=0x7fbe040430d8, n_ext=0, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:3298
            #12 0x00005572c1cc3ad2 in row_ins_index_entry (index=0x7fbe041756a8, entry=0x7fbe04172e18, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3406
            #13 0x00005572c1cc4094 in row_ins_index_entry_step (node=0x7fbe04058bf8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3556
            #14 0x00005572c1cc44ce in row_ins (node=0x7fbe04058bf8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3699
            #15 0x00005572c1cc4cd3 in row_ins_step (thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3944
            #16 0x00005572c1ce7248 in row_update_vers_insert (thr=0x7fbe040430d8, node=0x7fbe041732f8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:2185
            #17 0x00005572c1ce73d0 in row_update_cascade_for_mysql (thr=0x7fbe040430d8, node=0x7fbe041732f8, table=0x7fbe04038018) at /data/src/10.3/storage/innobase/row/row0mysql.cc:2240
            #18 0x00005572c1cbead1 in row_ins_foreign_check_on_constraint (thr=0x7fbe040430d8, foreign=0x7fbe04055028, pcur=0x7fbe580716a0, entry=0x7fbe04172210, mtr=0x7fbe58071ac0) at /data/src/10.3/storage/innobase/row/row0ins.cc:1448
            #19 0x00005572c1cbf988 in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7fbe04055028, table=0x7fbe040737f8, entry=0x7fbe04172210, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:1850
            #20 0x00005572c1d3c40b in row_upd_check_references_constraints (node=0x7fbe0403c9a8, pcur=0x7fbe58072150, table=0x7fbe040737f8, index=0x7fbe040a7cc8, offsets=0x7fbe04171bf0, thr=0x7fbe040430d8, mtr=0x7fbe58072670) at /data/src/10.3/storage/innobase/row/row0upd.cc:297
            #21 0x00005572c1d4143e in row_upd_sec_index_entry (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:2516
            #22 0x00005572c1d4170d in row_upd_sec_step (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:2563
            #23 0x00005572c1d43efc in row_upd (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:3331
            #24 0x00005572c1d44264 in row_upd_step (thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:3446
            #25 0x00005572c1ce66e0 in row_update_for_mysql (prebuilt=0x7fbe0403bcc8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:1889
            #26 0x00005572c1b8f3b9 in ha_innobase::delete_row (this=0x7fbe0406fb98, record=0x7fbe04070550 "\245\002") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9002
            #27 0x00005572c18779ea in handler::ha_delete_row (this=0x7fbe0406fb98, buf=0x7fbe04070550 "\245\002") at /data/src/10.3/sql/handler.cc:6407
            #28 0x00005572c153177b in write_record (thd=0x7fbe04000b00, table=0x7fbe0406ef50, info=0x7fbe04016460) at /data/src/10.3/sql/sql_insert.cc:1968
            #29 0x00005572c1536cb4 in select_insert::send_data (this=0x7fbe04016418, values=...) at /data/src/10.3/sql/sql_insert.cc:3851
            #30 0x00005572c15e5628 in end_send (join=0x7fbe040164c8, join_tab=0x7fbe04018018, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:20580
            #31 0x00005572c15e2e38 in evaluate_join_record (join=0x7fbe040164c8, join_tab=0x7fbe04017c68, error=0) at /data/src/10.3/sql/sql_select.cc:19616
            #32 0x00005572c15f7e36 in AGGR_OP::end_send (this=0x7fbe04018568) at /data/src/10.3/sql/sql_select.cc:27447
            #33 0x00005572c15e21c3 in sub_select_postjoin_aggr (join=0x7fbe040164c8, join_tab=0x7fbe04017c68, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19112
            #34 0x00005572c15e24f0 in sub_select (join=0x7fbe040164c8, join_tab=0x7fbe040178b8, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19347
            #35 0x00005572c15e1cb8 in do_select (join=0x7fbe040164c8, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18938
            #36 0x00005572c15ba821 in JOIN::exec_inner (this=0x7fbe040164c8) at /data/src/10.3/sql/sql_select.cc:4040
            #37 0x00005572c15b9c62 in JOIN::exec (this=0x7fbe040164c8) at /data/src/10.3/sql/sql_select.cc:3834
            #38 0x00005572c15baf02 in mysql_select (thd=0x7fbe04000b00, tables=0x7fbe04015590, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7fbe04016418, unit=0x7fbe040049c8, select_lex=0x7fbe04005138) at /data/src/10.3/sql/sql_select.cc:4239
            #39 0x00005572c15ace22 in handle_select (thd=0x7fbe04000b00, lex=0x7fbe04004900, result=0x7fbe04016418, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:385
            #40 0x00005572c15711f2 in mysql_execute_command (thd=0x7fbe04000b00) at /data/src/10.3/sql/sql_parse.cc:4884
            #41 0x00005572c157b7e0 in mysql_parse (thd=0x7fbe04000b00, rawbuf=0x7fbe04014cf8 "REPLACE INTO t2 SELECT * FROM t2", length=32, parser_state=0x7fbe580745f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8142
            #42 0x00005572c15688cb in dispatch_command (command=COM_QUERY, thd=0x7fbe04000b00, packet=0x7fbe041622e1 "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:1854
            #43 0x00005572c15672b5 in do_command (thd=0x7fbe04000b00) at /data/src/10.3/sql/sql_parse.cc:1396
            #44 0x00005572c16cfb2b in do_handle_one_connection (connect=0x5572c59d3110) at /data/src/10.3/sql/sql_connect.cc:1403
            #45 0x00005572c16cf8af in handle_one_connection (arg=0x5572c59d3110) at /data/src/10.3/sql/sql_connect.cc:1309
            #46 0x00005572c1b6c207 in pfs_spawn_thread (arg=0x5572c5918400) at /data/src/10.3/storage/perfschema/pfs.cc:1862
            #47 0x00007fbe601a5494 in start_thread (arg=0x7fbe58075700) at pthread_create.c:333
            #48 0x00007fbe5e58b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            The test case uses system versioning, so I cannot confirm whether earlier versions are affected or not.

            elenst Elena Stepanova added a comment - Test case: --source include/have_innodb.inc   CREATE TABLE t1 ( pk int , f1 varchar (255) CHARACTER SET ucs2, f2 longtext CHARACTER SET ucs2, f3 varchar (255), f4 char (255), f5 longtext CHARACTER SET ucs2, f6 INT , f7 INT , f8 INT , f9 INT , f10 INT , f11 INT , f12 varchar (255) CHARACTER SET ucs2, f13 char (255) CHARACTER SET ucs2, f14 char (255) CHARACTER SET ucs2, f15 varchar (255), f16 longtext, f17 char (255), primary key (pk) ) ENGINE=InnoDB WITH SYSTEM VERSIONING;   INSERT INTO t1 VALUES (1, 'a' , 'e' , 'f' , 'a' , 'generate' , 1, 2, 3, 4, 5, 6, 'main' , 'against' , 'b' , 'u' , 'explode' , 'tomorrow' ), (2, REPEAT( 'a' ,127), 'f' , 'k' , 'game' , 'g' , 2, 3, 4, 5, 6, 7, REPEAT( 'o' ,222), 'oven' , 'flower' , REPEAT( 'r' ,120), 'l' , 'g' ), (3, 'weekly' , 'x' , 'v' , 'r' , 'c' , 3, 4, 5, 6, 7, 8, 'validity' , 'y' , 'h' , 'oxygen' , 'venture' , 'uncertainty' ), (4, 'r' , 't' , REPEAT( 'b' ,153), 'modern' , 'h' , 4, 5, 6, 7, 8, 9, REPEAT( 'g' ,128), 'a' , 'w' , 'f' , 'b' , 'b' ), (5, 'h' , 'y' , REPEAT( 'v' ,107), 'knife' , 'profession' , 5, 6, 7, 8, 9, 0, 'infection' , 'u' , 'likelihood' , REPEAT( 'n' ,149), 'folk' , 'd' ), (6, 'g' , 'violent' , REPEAT( 'o' ,28), 'capital' , 'p' , 6, 7, 8, 9, 0, 1, 'w' , 'patron' , 'd' , 'y' , 'originally' , 'k' ), (7, 'k' , 'uncomfortable' , REPEAT( 'v' ,248), 'y' , 'link' , 7, 8, 9, 0, 1, 2, REPEAT( 'j' ,204), 'j' , 'statute' , 'emphasis' , 'u' , 'water' ), (8, 'preparation' , 'water' , 'suck' , 'silver' , 'a' , 8, 9, 0, 1, 2, 3, 'h' , 'q' , 'o' , 't' , 'k' , 'y' ), (9, 'y' , 'f' , 'e' , 'a' , 'dawn' , 9, 0, 1, 2, 3, 4, 'peak' , 'parking' , 'b' , 't' , 'timber' , 'c' ), (10, REPEAT( 'h' ,78), 'apologize' , 'direct' , 'u' , 'frankly' , 0, 1, 2, 3, 4, 5, 'h' , 'exhibit' , 'f' , 'd' , 'effective' , 'c' ), (11, 'i' , 'h' , 'a' , 'y' , 'u' , 1, 2, 3, 4, 5, 6, 'l' , 'b' , '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, 'against' ),(2, 'q' );   SET SQL_MODE= '' ; SELECT * FROM t1 INTO OUTFILE 't1.data' ; UPDATE t1 SET f13 = 'q' ; 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; SELECT * FROM t2 INTO OUTFILE 't2.data' ; LOAD DATA INFILE 't2.data' REPLACE INTO TABLE t2; SET FOREIGN_KEY_CHECKS = OFF ; ALTER TABLE t1 ADD FOREIGN KEY (f13) REFERENCES t2 (f) ON DELETE SET NULL ; LOAD DATA INFILE 't1.data' REPLACE INTO TABLE t1; 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 51e48b9f 2019-03-20 0:34:32 9 [ERROR] InnoDB: Records in wrong order on space 5 page 11 index `PRIMARY`   InnoDB: previous record PHYSICAL RECORD: n_fields 22; compact format; info bits 0 0: len 4; hex 80000008; asc ;; 1: len 7; hex 5c916e780b7982; asc \ nx y ;; 2: len 6; hex 000000000000; asc ;; 3: len 7; hex 80000000000000; asc ;; 4: len 30; hex 000000700000007200000065000000700000006100000072000000610000; asc p r e p a r a ; (total 44 bytes); 5: len 20; hex 0000007700000061000000740000006500000072; asc w a t e r;; 6: len 4; hex 7375636b; asc suck;; 7: len 30; hex 73696c766572202020202020202020202020202020202020202020202020; asc silver ; (total 255 bytes); 8: len 4; hex 00000061; asc a;; 9: len 4; hex 80000008; asc ;; 10: len 4; hex 80000009; asc ;; 11: len 4; hex 80000000; asc ;; 12: len 4; hex 80000001; asc ;; 13: len 4; hex 80000002; asc ;; 14: len 4; hex 80000003; asc ;; 15: len 4; hex 00000068; asc h;; 16: len 30; hex 000000710020002000200020002000200020002000200020002000200020; asc q ; (total 510 bytes); 17: len 30; hex 0000006f0020002000200020002000200020002000200020002000200020; asc o ; (total 510 bytes); 18: len 1; hex 74; asc t;; 19: len 1; hex 6b; asc k;; 20: len 30; hex 792020202020202020202020202020202020202020202020202020202020; asc y ; (total 255 bytes); 21: len 7; hex 5c916e780b53e0; asc \ nx S ;;   InnoDB: record PHYSICAL RECORD: n_fields 22; compact format; info bits 0 0: len 4; hex 20202020; asc ;; 1: len 7; hex 5c916e780b9987; asc \ nx ;; 2: len 6; hex 00000000003b; asc ;;; 3: len 7; hex 8f000001410c69; asc A i;; 4: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc ; (total 44 bytes); 5: len 20; hex 2020202020202020202020202020202020202020; asc ;; 6: len 4; hex 20202020; asc ;; 7: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc ; (total 255 bytes); 8: len 4; hex 00000000; asc ;; 9: len 4; hex 00000000; asc ;; 10: len 4; hex 00000000; asc ;; 11: len 4; hex 00000000; asc ;; 12: len 4; hex 00000000; asc ;; 13: len 4; hex 00000000; asc ;; 14: len 4; hex 00000000; asc ;; 15: len 4; hex 00000000; asc ;; 16: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 510 bytes); 17: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 510 bytes); 18: len 1; hex 00; asc ;; 19: len 1; hex 00; asc ;; 20: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 255 bytes); 21: len 7; hex 00000000000000; asc ;;   2019-03-20 0:34:32 9 [ERROR] InnoDB: Apparent corruption in space 5 page 11 index `PRIMARY` 2019-03-20 0:34:32 9 [ERROR] InnoDB: Records in wrong order on space 5 page 11 index `PRIMARY`   InnoDB: previous record PHYSICAL RECORD: n_fields 22; compact format; info bits 0 0: len 4; hex 80000008; asc ;; 1: len 7; hex 5c916e780b7982; asc \ nx y ;; 2: len 6; hex 000000000000; asc ;; 3: len 7; hex 80000000000000; asc ;; 4: len 30; hex 000000700000007200000065000000700000006100000072000000610000; asc p r e p a r a ; (total 44 bytes); 5: len 20; hex 0000007700000061000000740000006500000072; asc w a t e r;; 6: len 4; hex 7375636b; asc suck;; 7: len 30; hex 73696c766572202020202020202020202020202020202020202020202020; asc silver ; (total 255 bytes); 8: len 4; hex 00000061; asc a;; 9: len 4; hex 80000008; asc ;; 10: len 4; hex 80000009; asc ;; 11: len 4; hex 80000000; asc ;; 12: len 4; hex 80000001; asc ;; 13: len 4; hex 80000002; asc ;; 14: len 4; hex 80000003; asc ;; 15: len 4; hex 00000068; asc h;; 16: len 30; hex 000000710020002000200020002000200020002000200020002000200020; asc q ; (total 510 bytes); 17: len 30; hex 0000006f0020002000200020002000200020002000200020002000200020; asc o ; (total 510 bytes); 18: len 1; hex 74; asc t;; 19: len 1; hex 6b; asc k;; 20: len 30; hex 792020202020202020202020202020202020202020202020202020202020; asc y ; (total 255 bytes); 21: len 7; hex 5c916e780b53e0; asc \ nx S ;;   InnoDB: record PHYSICAL RECORD: n_fields 22; compact format; info bits 0 0: len 4; hex 20202020; asc ;; 1: len 7; hex 5c916e780b9987; asc \ nx ;; 2: len 6; hex 00000000003b; asc ;;; 3: len 7; hex 8f000001410c69; asc A i;; 4: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc ; (total 44 bytes); 5: len 20; hex 2020202020202020202020202020202020202020; asc ;; 6: len 4; hex 20202020; asc ;; 7: len 30; hex 202020202020202020202020202020202020202020202020202020202020; asc ; (total 255 bytes); 8: len 4; hex 00000000; asc ;; 9: len 4; hex 00000000; asc ;; 10: len 4; hex 00000000; asc ;; 11: len 4; hex 00000000; asc ;; 12: len 4; hex 00000000; asc ;; 13: len 4; hex 00000000; asc ;; 14: len 4; hex 00000000; asc ;; 15: len 4; hex 00000000; asc ;; 16: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 510 bytes); 17: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 510 bytes); 18: len 1; hex 00; asc ;; 19: len 1; hex 00; asc ;; 20: len 30; hex 000000000000000000000000000000000000000000000000000000000000; asc ; (total 255 bytes); 21: len 7; hex 00000000000000; asc ;; 2019-03-20 0:34:32 9 [ERROR] InnoDB: Apparent corruption in space 5 page 11 index `PRIMARY` mysqld: /data/src/10.3/storage/innobase/btr/btr0btr.cc:3320: rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(left_block), cursor->index)' failed. 190320 0:34:32 [ERROR] mysqld got signal 6 ;   #7 0x00007fbe5e4ceee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x00005572c1dc748e in btr_page_split_and_insert (flags=0, cursor=0x7fbe58070770, offsets=0x7fbe58070708, heap=0x7fbe58070700, tuple=0x7fbe04172e18, n_ext=0, mtr=0x7fbe58070b90) at /data/src/10.3/storage/innobase/btr/btr0btr.cc:3320 #11 0x00005572c1cc370d in row_ins_clust_index_entry (index=0x7fbe041756a8, entry=0x7fbe04172e18, thr=0x7fbe040430d8, n_ext=0, dup_chk_only=false) at /data/src/10.3/storage/innobase/row/row0ins.cc:3298 #12 0x00005572c1cc3ad2 in row_ins_index_entry (index=0x7fbe041756a8, entry=0x7fbe04172e18, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3406 #13 0x00005572c1cc4094 in row_ins_index_entry_step (node=0x7fbe04058bf8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3556 #14 0x00005572c1cc44ce in row_ins (node=0x7fbe04058bf8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3699 #15 0x00005572c1cc4cd3 in row_ins_step (thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:3944 #16 0x00005572c1ce7248 in row_update_vers_insert (thr=0x7fbe040430d8, node=0x7fbe041732f8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:2185 #17 0x00005572c1ce73d0 in row_update_cascade_for_mysql (thr=0x7fbe040430d8, node=0x7fbe041732f8, table=0x7fbe04038018) at /data/src/10.3/storage/innobase/row/row0mysql.cc:2240 #18 0x00005572c1cbead1 in row_ins_foreign_check_on_constraint (thr=0x7fbe040430d8, foreign=0x7fbe04055028, pcur=0x7fbe580716a0, entry=0x7fbe04172210, mtr=0x7fbe58071ac0) at /data/src/10.3/storage/innobase/row/row0ins.cc:1448 #19 0x00005572c1cbf988 in row_ins_check_foreign_constraint (check_ref=0, foreign=0x7fbe04055028, table=0x7fbe040737f8, entry=0x7fbe04172210, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0ins.cc:1850 #20 0x00005572c1d3c40b in row_upd_check_references_constraints (node=0x7fbe0403c9a8, pcur=0x7fbe58072150, table=0x7fbe040737f8, index=0x7fbe040a7cc8, offsets=0x7fbe04171bf0, thr=0x7fbe040430d8, mtr=0x7fbe58072670) at /data/src/10.3/storage/innobase/row/row0upd.cc:297 #21 0x00005572c1d4143e in row_upd_sec_index_entry (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:2516 #22 0x00005572c1d4170d in row_upd_sec_step (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:2563 #23 0x00005572c1d43efc in row_upd (node=0x7fbe0403c9a8, thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:3331 #24 0x00005572c1d44264 in row_upd_step (thr=0x7fbe040430d8) at /data/src/10.3/storage/innobase/row/row0upd.cc:3446 #25 0x00005572c1ce66e0 in row_update_for_mysql (prebuilt=0x7fbe0403bcc8) at /data/src/10.3/storage/innobase/row/row0mysql.cc:1889 #26 0x00005572c1b8f3b9 in ha_innobase::delete_row (this=0x7fbe0406fb98, record=0x7fbe04070550 "\245\002") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9002 #27 0x00005572c18779ea in handler::ha_delete_row (this=0x7fbe0406fb98, buf=0x7fbe04070550 "\245\002") at /data/src/10.3/sql/handler.cc:6407 #28 0x00005572c153177b in write_record (thd=0x7fbe04000b00, table=0x7fbe0406ef50, info=0x7fbe04016460) at /data/src/10.3/sql/sql_insert.cc:1968 #29 0x00005572c1536cb4 in select_insert::send_data (this=0x7fbe04016418, values=...) at /data/src/10.3/sql/sql_insert.cc:3851 #30 0x00005572c15e5628 in end_send (join=0x7fbe040164c8, join_tab=0x7fbe04018018, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:20580 #31 0x00005572c15e2e38 in evaluate_join_record (join=0x7fbe040164c8, join_tab=0x7fbe04017c68, error=0) at /data/src/10.3/sql/sql_select.cc:19616 #32 0x00005572c15f7e36 in AGGR_OP::end_send (this=0x7fbe04018568) at /data/src/10.3/sql/sql_select.cc:27447 #33 0x00005572c15e21c3 in sub_select_postjoin_aggr (join=0x7fbe040164c8, join_tab=0x7fbe04017c68, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19112 #34 0x00005572c15e24f0 in sub_select (join=0x7fbe040164c8, join_tab=0x7fbe040178b8, end_of_records=true) at /data/src/10.3/sql/sql_select.cc:19347 #35 0x00005572c15e1cb8 in do_select (join=0x7fbe040164c8, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18938 #36 0x00005572c15ba821 in JOIN::exec_inner (this=0x7fbe040164c8) at /data/src/10.3/sql/sql_select.cc:4040 #37 0x00005572c15b9c62 in JOIN::exec (this=0x7fbe040164c8) at /data/src/10.3/sql/sql_select.cc:3834 #38 0x00005572c15baf02 in mysql_select (thd=0x7fbe04000b00, tables=0x7fbe04015590, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7fbe04016418, unit=0x7fbe040049c8, select_lex=0x7fbe04005138) at /data/src/10.3/sql/sql_select.cc:4239 #39 0x00005572c15ace22 in handle_select (thd=0x7fbe04000b00, lex=0x7fbe04004900, result=0x7fbe04016418, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:385 #40 0x00005572c15711f2 in mysql_execute_command (thd=0x7fbe04000b00) at /data/src/10.3/sql/sql_parse.cc:4884 #41 0x00005572c157b7e0 in mysql_parse (thd=0x7fbe04000b00, rawbuf=0x7fbe04014cf8 "REPLACE INTO t2 SELECT * FROM t2", length=32, parser_state=0x7fbe580745f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8142 #42 0x00005572c15688cb in dispatch_command (command=COM_QUERY, thd=0x7fbe04000b00, packet=0x7fbe041622e1 "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:1854 #43 0x00005572c15672b5 in do_command (thd=0x7fbe04000b00) at /data/src/10.3/sql/sql_parse.cc:1396 #44 0x00005572c16cfb2b in do_handle_one_connection (connect=0x5572c59d3110) at /data/src/10.3/sql/sql_connect.cc:1403 #45 0x00005572c16cf8af in handle_one_connection (arg=0x5572c59d3110) at /data/src/10.3/sql/sql_connect.cc:1309 #46 0x00005572c1b6c207 in pfs_spawn_thread (arg=0x5572c5918400) at /data/src/10.3/storage/perfschema/pfs.cc:1862 #47 0x00007fbe601a5494 in start_thread (arg=0x7fbe58075700) at pthread_create.c:333 #48 0x00007fbe5e58b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6 The test case uses system versioning, so I cannot confirm whether earlier versions are affected or not.
            elenst Elena Stepanova made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4.4 [ 23310 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Summary Draft: rec_t* btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(right_block), cursor->index)' failed in btr0btr.cc InnoDB: Records in wrong order, btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(right_block), cursor->index)' failed in btr0btr.cc
            elenst Elena Stepanova made changes -
            Assignee Marko Mäkelä [ marko ]
            elenst Elena Stepanova made changes -
            Description {noformat}
            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> \
            {noformat}
            {noformat}
            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> \
            {noformat}

            ----
            UPDATE: See MTR test case in the [comment|https://jira.mariadb.org/browse/MDEV-18879?focusedCommentId=125048&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-125048].
            elenst Elena Stepanova made changes -
            Fix Version/s 10.4.4 [ 23310 ]

            This could be sharing a common cause with MDEV-18910, which is repeatable with a much more esoteric test case.

            marko Marko Mäkelä added a comment - This could be sharing a common cause with MDEV-18910 , which is repeatable with a much more esoteric test case.
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Component/s Versioned Tables [ 14303 ]
            Assignee Marko Mäkelä [ marko ] Aleksey Midenkov [ midenok ]

            The corruption occurs, because the btr_page_reorganize() call between the two page_cur_tuple_insert() calls in btr_page_split_and_insert() is trashing the key. This happened, because the row tuple was copied in an unsafe way. With the following fix, the test case will not crash:

            diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
            index 94a4ad3d122..d596900a3c3 100644
            --- a/storage/innobase/row/row0ins.cc
            +++ b/storage/innobase/row/row0ins.cc
            @@ -1413,9 +1413,9 @@ row_ins_foreign_check_on_constraint(
             	if (table->versioned() && cascade->is_delete != PLAIN_DELETE
             	    && cascade->update->affects_versioned()) {
             		ut_ad(!cascade->historical_heap);
            -		cascade->historical_heap = mem_heap_create(128);
            +		cascade->historical_heap = mem_heap_create(srv_page_size);
             		cascade->historical_row = row_build(
            -			ROW_COPY_POINTERS, clust_index, clust_rec, NULL, table,
            +			ROW_COPY_DATA, clust_index, clust_rec, NULL, table,
             			NULL, NULL, NULL, cascade->historical_heap);
             	}
             
            

            It turns out that this bug cannot explain the corruption that was filed in MDEV-18910, because that test case does not involve FOREIGN KEY at all.

            marko Marko Mäkelä added a comment - The corruption occurs, because the btr_page_reorganize() call between the two page_cur_tuple_insert() calls in btr_page_split_and_insert() is trashing the key. This happened, because the row tuple was copied in an unsafe way. With the following fix, the test case will not crash: diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 94a4ad3d122..d596900a3c3 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1413,9 +1413,9 @@ row_ins_foreign_check_on_constraint( if (table->versioned() && cascade->is_delete != PLAIN_DELETE && cascade->update->affects_versioned()) { ut_ad(!cascade->historical_heap); - cascade->historical_heap = mem_heap_create(128); + cascade->historical_heap = mem_heap_create(srv_page_size); cascade->historical_row = row_build( - ROW_COPY_POINTERS, clust_index, clust_rec, NULL, table, + ROW_COPY_DATA, clust_index, clust_rec, NULL, table, NULL, NULL, NULL, cascade->historical_heap); } It turns out that this bug cannot explain the corruption that was filed in MDEV-18910 , because that test case does not involve FOREIGN KEY at all.
            marko Marko Mäkelä made changes -
            Fix Version/s 10.3.14 [ 23216 ]
            Fix Version/s 10.4.4 [ 23310 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Assignee Aleksey Midenkov [ midenok ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Summary InnoDB: Records in wrong order, btr_page_split_and_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, const dtuple_t*, ulint, mtr_t*): Assertion `page_validate(buf_block_get_frame(right_block), cursor->index)' failed in btr0btr.cc WITH SYSTEM VERSIONING and FOREIGN KEY can insert a corrupted record
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2019-03-20 16:59:02.0 2019-03-20 16:59:02.781
            marko Marko Mäkelä made changes -
            Resolution Fixed [ 1 ]
            Status Confirmed [ 10101 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 93102 ] MariaDB v4 [ 155891 ]
            nikitamalyavin Nikita Malyavin made changes -

            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.