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

Wrong results after ADD UNIQUE INDEX(blob_column)

    XMLWordPrintable

Details

    Description

      Problem found during RQG testing

      --source include/have_innodb.inc
      --disable_abort_on_error
       
      --source include/have_innodb.inc
      # harmless!! col1 VARCHAR(30)
      CREATE TABLE t1 (
           col1 VARCHAR(7961) , col2 INTEGER
      ) ENGINE=InnoDB ;
       
      INSERT INTO t1 ( col2, col1) VALUES
        (4, '8') , (2, '4') , (4, '4') , (8, '4') ;
       
      SELECT col1, col2 FROM `t1` INTO OUTFILE 'load_t1'  ;
       
      # This is harmless
      # ALTER TABLE `t1` ADD IF NOT EXISTS ( `col1` SERIAL ) ;
        ALTER IGNORE TABLE `t1` ADD IF NOT EXISTS ( `col1` SERIAL ) ;
      ALTER TABLE `t1` ADD SYSTEM VERSIONING ;
      LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 ;   # <== assert
       
      --enable_abort_on_error
      DROP TABLE t1;
       
      Version: '10.4.4-MariaDB-debug-log'  socket: 'bld_debug/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
      2019-03-12 12:57:20 9 [ERROR] InnoDB: Record in index `col1` of table `test`.`t1` was not found on update: TUPLE (info_bits=0, 2 fields): {[8]  0    .(0x191D3085F812D82E),[6]      (0x000000000209)} at: COMPACT RECORD(info_bits=0, 2 fields): {[8]  0    .(0x191D3085F812D82E),[6]      (0x000000000207)}
      mysqld: storage/innobase/row/row0upd.cc:2430: dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*): Assertion `0' failed.
      190312 12:57:20 [ERROR] mysqld got signal 6 ;
      ...
      Query (0x7fdf80014730): LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1
      Connection ID (thread ID): 9
      Status: NOT_KILLED
      ...
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007fdfdb520f5d in __GI_abort () at abort.c:90
      #6  0x00007fdfdb516f17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55b1bf357c71 "0", file=file@entry=0x55b1bf359428 "storage/innobase/row/row0upd.cc", line=line@entry=2430, function=function@entry=0x55b1bf35c400 <row_upd_sec_index_entry(upd_node_t*, que_thr_t*)::__PRETTY_FUNCTION__> "dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*)") at assert.c:92
      #7  0x00007fdfdb516fc2 in __GI___assert_fail (assertion=0x55b1bf357c71 "0", file=0x55b1bf359428 "storage/innobase/row/row0upd.cc", line=2430, function=0x55b1bf35c400 <row_upd_sec_index_entry(upd_node_t*, que_thr_t*)::__PRETTY_FUNCTION__> "dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*)") at assert.c:101
      #8  0x000055b1bebd7273 in row_upd_sec_index_entry (node=0x7fdf80079438, thr=0x7fdf800797d0) at storage/innobase/row/row0upd.cc:2430
      #9  0x000055b1bebd7960 in row_upd_sec_step (node=0x7fdf80079438, thr=0x7fdf800797d0) at storage/innobase/row/row0upd.cc:2543
      #10 0x000055b1bebda3ca in row_upd (node=0x7fdf80079438, thr=0x7fdf800797d0) at storage/innobase/row/row0upd.cc:3322
      #11 0x000055b1bebda731 in row_upd_step (thr=0x7fdf800797d0) at storage/innobase/row/row0upd.cc:3437
      #12 0x000055b1beb88197 in row_update_for_mysql (prebuilt=0x7fdf80149788) at storage/innobase/row/row0mysql.cc:1890
      #13 0x000055b1bea20cf0 in ha_innobase::update_row (this=0x7fdf801787d0, old_row=0x7fdf800732e8 "\240\001", new_row=0x7fdf800713b0 "\370\001") at storage/innobase/handler/ha_innodb.cc:8895
      #14 0x000055b1be800f09 in handler::ha_update_row (this=0x7fdf801787d0, old_data=0x7fdf800732e8 "\240\001", new_data=0x7fdf800713b0 "\370\001") at sql/handler.cc:6747
      #15 0x000055b1be4652ec in write_record (thd=0x7fdf80000ce8, table=0x7fdf80130e28, info=0x7fdfd483b000) at sql/sql_insert.cc:1941
      #16 0x000055b1be49ad58 in read_sep_field (thd=0x7fdf80000ce8, info=..., table_list=0x7fdf80014898, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=false) at sql/sql_load.cc:1157
      #17 0x000055b1be499385 in mysql_load (thd=0x7fdf80000ce8, ex=0x7fdf80014810, table_list=0x7fdf80014898, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_REPLACE, ignore=false, read_file_from_client=false) at sql/sql_load.cc:665
      #18 0x000055b1be4b03f2 in mysql_execute_command (thd=0x7fdf80000ce8) at sql/sql_parse.cc:5230
      #19 0x000055b1be4ba88f in mysql_parse (thd=0x7fdf80000ce8, rawbuf=0x7fdf80014730 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1", length=48, parser_state=0x7fdfd483c170, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8204
      #20 0x000055b1be4a5ba0 in dispatch_command (command=COM_QUERY, thd=0x7fdf80000ce8, packet=0x7fdf8000a189 "LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 ", packet_length=49, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1828
      #21 0x000055b1be4a435f in do_command (thd=0x7fdf80000ce8) at sql/sql_parse.cc:1357
      #22 0x000055b1be61cceb in do_handle_one_connection (connect=0x55b1c1a82548) at sql/sql_connect.cc:1399
      #23 0x000055b1be61ca4f in handle_one_connection (arg=0x55b1c1a82548) at sql/sql_connect.cc:1302
      #24 0x000055b1bef519aa in pfs_spawn_thread (arg=0x55b1c1ab90d8) at storage/perfschema/pfs.cc:1862
      #25 0x00007fdfdc3c67fc in start_thread (arg=0x7fdfd483d700) at pthread_create.c:465
      #26 0x00007fdfdb5fcb5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Replay on
      10.4 commit 6d68a3464e9a93baecc277a2c270cad28fbf50bd 2019-03-11
       
      The results on
      10.3.14 commit 09bd2138522787a4e0b015695c462903f4a9e728 2019-02-22
      10.2.22 commit 28e713dc12881e7f50207d0c642523ca3e630114 2019-03-11
      are different (no asserts) but bad too (https://jira.mariadb.org/browse/MDEV-18927).
      
      

      Attachments

        Issue Links

          Activity

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              mleich Matthias Leich
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.