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

Server crashes in row_upd_build_difference_binary on LOAD DATA into table with indexed virtual column

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 ( 
        pk INT,
        i TINYINT,
        ts TIMESTAMP NULL,
        vi TINYINT AS (i+1) PERSISTENT,
        vts TIMESTAMP(5) AS (ts) VIRTUAL,
        PRIMARY KEY(pk),
        UNIQUE(vts)
      ) ENGINE=InnoDB
      ;
      INSERT IGNORE INTO t1 (pk,i) VALUES (1,127);
       
      --write_file $MYSQLTEST_VARDIR/tmp/load.data
      1	4	2019-01-01 00:00:00
      EOF
      eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts);
       
      # Cleanup
      DROP TABLE t1;
      --remove_file $MYSQLTEST_VARDIR/tmp/load.data
      

      10.2 3728b11f8

      #3  <signal handler called>
      #4  0x000055934f4153ac in row_upd_build_difference_binary (index=0x7f277806b2b8, entry=0x7f2778099f68, rec=0x7f27ca00007e "\200", offsets=0x7f27c07f4460, no_sys=true, trx=0x7f27ca333148, heap=0x7f277800b5d0, mysql_table=0x7f277800aa50) at /data/src/10.2/storage/innobase/row/row0upd.cc:1165
      #5  0x000055934f39a3ce in row_ins_clust_index_entry_by_modify (pcur=0x7f27c07f4910, flags=0, mode=2, offsets=0x7f27c07f48b0, offsets_heap=0x7f27c07f48a8, heap=0x7f277800b5d0, entry=0x7f2778099f68, thr=0x7f277808c568, mtr=0x7f27c07f4d30) at /data/src/10.2/storage/innobase/row/row0ins.cc:352
      #6  0x000055934f39fb06 in row_ins_clust_index_entry_low (flags=0, mode=2, index=0x7f277806b2b8, n_uniq=1, entry=0x7f2778099f68, n_ext=0, thr=0x7f277808c568, dup_chk_only=false) at /data/src/10.2/storage/innobase/row/row0ins.cc:2650
      #7  0x000055934f3a125b in row_ins_clust_index_entry (index=0x7f277806b2b8, entry=0x7f2778099f68, thr=0x7f277808c568, n_ext=0, dup_chk_only=false) at /data/src/10.2/storage/innobase/row/row0ins.cc:3170
      #8  0x000055934f3a1673 in row_ins_index_entry (index=0x7f277806b2b8, entry=0x7f2778099f68, thr=0x7f277808c568) at /data/src/10.2/storage/innobase/row/row0ins.cc:3292
      #9  0x000055934f3a1b7b in row_ins_index_entry_step (node=0x7f277808c298, thr=0x7f277808c568) at /data/src/10.2/storage/innobase/row/row0ins.cc:3442
      #10 0x000055934f3a1f6e in row_ins (node=0x7f277808c298, thr=0x7f277808c568) at /data/src/10.2/storage/innobase/row/row0ins.cc:3585
      #11 0x000055934f3a2547 in row_ins_step (thr=0x7f277808c568) at /data/src/10.2/storage/innobase/row/row0ins.cc:3811
      #12 0x000055934f3bfa3d in row_insert_for_mysql (mysql_rec=0x7f277806abd0 "\341\001", prebuilt=0x7f277808bcb8) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1413
      #13 0x000055934f284640 in ha_innobase::write_row (this=0x7f277806c958, record=0x7f277806abd0 "\341\001") at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:8207
      #14 0x000055934ef7a567 in handler::ha_write_row (this=0x7f277806c958, buf=0x7f277806abd0 "\341\001") at /data/src/10.2/sql/handler.cc:5961
      #15 0x000055934eccffc6 in write_record (thd=0x7f2778000b00, table=0x7f277800aa50, info=0x7f27c07f6040) at /data/src/10.2/sql/sql_insert.cc:1655
      #16 0x000055934f1153e4 in read_sep_field (thd=0x7f2778000b00, info=..., table_list=0x7f2778012630, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=false) at /data/src/10.2/sql/sql_load.cc:1256
      #17 0x000055934f11357c in mysql_load (thd=0x7f2778000b00, ex=0x7f27780125a8, table_list=0x7f2778012630, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_REPLACE, ignore=false, read_file_from_client=false) at /data/src/10.2/sql/sql_load.cc:649
      #18 0x000055934ecf6dfc in mysql_execute_command (thd=0x7f2778000b00) at /data/src/10.2/sql/sql_parse.cc:4834
      #19 0x000055934ed00b5d in mysql_parse (thd=0x7f2778000b00, rawbuf=0x7f2778012448 "LOAD DATA INFILE '/data/bld/10.2/mysql-test/var/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts)", length=94, parser_state=0x7f27c07f7200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8013
      #20 0x000055934ecee495 in dispatch_command (command=COM_QUERY, thd=0x7f2778000b00, packet=0x7f2778095ec1 "LOAD DATA INFILE '/data/bld/10.2/mysql-test/var/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts)", packet_length=94, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
      #21 0x000055934ececdf8 in do_command (thd=0x7f2778000b00) at /data/src/10.2/sql/sql_parse.cc:1378
      #22 0x000055934ee3f537 in do_handle_one_connection (connect=0x559351530ea0) at /data/src/10.2/sql/sql_connect.cc:1335
      #23 0x000055934ee3f2c4 in handle_one_connection (arg=0x559351530ea0) at /data/src/10.2/sql/sql_connect.cc:1241
      #24 0x000055934f264f46 in pfs_spawn_thread (arg=0x55935147c350) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #25 0x00007f27d1e7d494 in start_thread (arg=0x7f27c07f8700) at pthread_create.c:333
      #26 0x00007f27d047e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Crashes on debug and non-debug builds. ASAN also ends with SEGV.

      Not reproducible on 10.1.

      There is some resemblance of the test case with MDEV-17837, might be related.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.