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

Server crash or assertion (type.vers_sys_end()) failure upon inplace ALTER with virtual columns

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 ( 
          a INT,
          b INT AS (a) VIRTUAL,
          c INT,
          d INT AS (c) VIRTUAL,
          e INT,
          f INT AS (e) VIRTUAL,
          g INT,
          h INT,
          i INT,
          INDEX(d),
          KEY(h),
          FOREIGN KEY (g) REFERENCES t1 (h)
      ) ENGINE=InnoDB WITH SYSTEM VERSIONING;
       
      SET system_versioning_alter_history= KEEP;
      ALTER TABLE t1 DROP COLUMN i;
      INSERT INTO t1 (g,h) VALUES (1,1);
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 37570e84

      mysqld: /data/src/10.4/storage/innobase/include/data0data.h:498: bool dfield_t::vers_history_row() const: Assertion `type.vers_sys_end()' failed.
      191007 16:36:23 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fda257d1f12 in __GI___assert_fail (assertion=0x556e47f204fb "type.vers_sys_end()", file=0x556e47f20510 "/data/src/10.4/storage/innobase/include/data0data.h", line=498, function=0x556e47f24940 <dfield_t::vers_history_row() const::__PRETTY_FUNCTION__> "bool dfield_t::vers_history_row() const") at assert.c:101
      #8  0x0000556e476f034a in dfield_t::vers_history_row (this=0x7fd9cc14d440) at /data/src/10.4/storage/innobase/include/data0data.h:498
      #9  0x0000556e476e9a99 in row_ins_check_foreign_constraint (check_ref=1, foreign=0x7fd9cc15a328, table=0x7fd9cc05c918, entry=0x7fd9cc081d10, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:1645
      #10 0x0000556e476ea9a1 in row_ins_check_foreign_constraints (table=0x7fd9cc05c918, index=0x7fd9cc05f548, pk=false, entry=0x7fd9cc081d10, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:2024
      #11 0x0000556e476ee9a9 in row_ins_sec_index_entry (index=0x7fd9cc05f548, entry=0x7fd9cc081d10, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:3282
      #12 0x0000556e476eecfd in row_ins_index_entry (index=0x7fd9cc05f548, entry=0x7fd9cc081d10, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:3357
      #13 0x0000556e476ef55a in row_ins_index_entry_step (node=0x7fd9cc14d240, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:3524
      #14 0x0000556e476ef97e in row_ins (node=0x7fd9cc14d240, thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:3660
      #15 0x0000556e476f0129 in row_ins_step (thr=0x7fd9cc14d590) at /data/src/10.4/storage/innobase/row/row0ins.cc:3803
      #16 0x0000556e477151f4 in row_insert_for_mysql (mysql_rec=0x7fd9cc00be30 "\177\376", prebuilt=0x7fd9cc14cb68, ins_mode=ROW_INS_NORMAL) at /data/src/10.4/storage/innobase/row/row0mysql.cc:1463
      #17 0x0000556e47574c24 in ha_innobase::write_row (this=0x7fd9cc060108, record=0x7fd9cc00be30 "\177\376") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:8047
      #18 0x0000556e47338abc in handler::ha_write_row (this=0x7fd9cc060108, buf=0x7fd9cc00be30 "\177\376") at /data/src/10.4/sql/handler.cc:6674
      #19 0x0000556e46f82c00 in write_record (thd=0x7fd9cc000b00, table=0x7fd9cc1a1510, info=0x7fda1ab654a0) at /data/src/10.4/sql/sql_insert.cc:2035
      #20 0x0000556e46f7fcd8 in mysql_insert (thd=0x7fd9cc000b00, table_list=0x7fd9cc013218, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1076
      #21 0x0000556e46fcda5c in mysql_execute_command (thd=0x7fd9cc000b00) at /data/src/10.4/sql/sql_parse.cc:4524
      #22 0x0000556e46fda1e7 in mysql_parse (thd=0x7fd9cc000b00, rawbuf=0x7fd9cc013128 "INSERT INTO t1 (g,h) VALUES (1,1)", length=33, parser_state=0x7fda1ab66170, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7912
      #23 0x0000556e46fc547a in dispatch_command (command=COM_QUERY, thd=0x7fd9cc000b00, packet=0x7fd9cc137c01 "INSERT INTO t1 (g,h) VALUES (1,1)", packet_length=33, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1841
      #24 0x0000556e46fc3b07 in do_command (thd=0x7fd9cc000b00) at /data/src/10.4/sql/sql_parse.cc:1359
      #25 0x0000556e4714b1bb in do_handle_one_connection (connect=0x556e4a37f800) at /data/src/10.4/sql/sql_connect.cc:1412
      #26 0x0000556e4714af0a in handle_one_connection (arg=0x556e4a37f800) at /data/src/10.4/sql/sql_connect.cc:1316
      #27 0x0000556e47b4a209 in pfs_spawn_thread (arg=0x556e4a2fe160) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #28 0x00007fda273474a4 in start_thread (arg=0x7fda1ab67700) at pthread_create.c:456
      #29 0x00007fda2588ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Also reproducible on 10.5.
      Couldn't reproduce on 10.3.
      No obvious effect on a non-debug build.

      Test case for a non-debug build:

      --source include/have_innodb.inc
       
      SET @instant.save= @@innodb_instant_alter_column_allowed;
      SET GLOBAL innodb_instant_alter_column_allowed= NEVER;
       
      CREATE TABLE t (a INT, b INT AS (a), c INT, d INT AS (c), e INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
      INSERT INTO t (a,c,e) VALUES (1,2,3);
      SET system_versioning_alter_history= KEEP;
      ALTER TABLE t ADD (x INT, y INT);
       
      # Cleanup
      DROP TABLE t;
      SET GLOBAL innodb_instant_alter_column_allowed= @instant.save;
      

      10.4 900c4d69

      #2  <signal handler called>
      #3  __memcmp_avx2_movbe () at ../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:85
      #4  0x0000558594f6a3d8 in dfield_t::vers_history_row (this=<optimized out>) at /data/src/10.4/storage/innobase/include/data0data.h:506
      #5  row_merge_read_clustered_index (trx=trx@entry=0x7f7800744090, table=table@entry=0x7f78004a7670, old_table=<optimized out>, new_table=<optimized out>, online=online@entry=true, index=index@entry=0x7f77b403be58, fts_sort_idx=<optimized out>, psort_info=<optimized out>, files=<optimized out>, key_numbers=<optimized out>, n_index=<optimized out>, defaults=<optimized out>, add_v=<optimized out>, col_map=<optimized out>, add_autoinc=<optimized out>, sequence=..., block=<optimized out>, skip_pk_sort=<optimized out>, tmpfd=<optimized out>, stage=<optimized out>, pct_cost=<optimized out>, crypt_block=<optimized out>, eval_table=<optimized out>, allow_not_null=<optimized out>) at /data/src/10.4/storage/innobase/row/row0merge.cc:2135
      #6  0x0000558594f6d08e in row_merge_build_indexes (trx=<optimized out>, old_table=<optimized out>, new_table=<optimized out>, online=<optimized out>, indexes=0x7f77b403be58, key_numbers=<optimized out>, n_indexes=<optimized out>, table=<optimized out>, defaults=<optimized out>, col_map=<optimized out>, add_autoinc=<optimized out>, sequence=..., skip_pk_sort=<optimized out>, stage=<optimized out>, add_v=<optimized out>, eval_table=<optimized out>, allow_not_null=<optimized out>) at /data/src/10.4/storage/innobase/row/row0merge.cc:4697
      #7  0x0000558594ecc326 in ha_innobase::inplace_alter_table (this=0x7f77b411dc70, altered_table=<optimized out>, ha_alter_info=0x7f78004a75d0) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:8735
      #8  0x0000558594a5de3c in handler::ha_inplace_alter_table (ha_alter_info=0x7f78004a75d0, altered_table=0x7f78004a7670, this=<optimized out>) at /data/src/10.4/sql/handler.h:4355
      #9  mysql_inplace_alter_table (thd=thd@entry=0x7f77b4000c58, table_list=0x7f77b40101f8, table=table@entry=0x7f77b411f888, altered_table=altered_table@entry=0x7f78004a7670, ha_alter_info=ha_alter_info@entry=0x7f78004a75d0, alter_ctx=alter_ctx@entry=0x7f78004a8ea0, target_mdl_request=0x7f78004a8460) at /data/src/10.4/sql/sql_table.cc:7918
      #10 0x0000558594a6a790 in mysql_alter_table (thd=thd@entry=0x7f77b4000c58, new_db=new_db@entry=0x7f77b40052a0, new_name=new_name@entry=0x7f77b40056f8, create_info=create_info@entry=0x7f78004a9a90, table_list=<optimized out>, table_list@entry=0x7f77b40101f8, recreate_info=recreate_info@entry=0x7f78004a99b0, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>) at /data/src/10.4/sql/sql_table.cc:10446
      #11 0x0000558594ac5159 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7f77b4000c58) at /data/src/10.4/sql/sql_alter.cc:531
      #12 0x00005585949bc8f0 in mysql_execute_command (thd=thd@entry=0x7f77b4000c58) at /data/src/10.4/sql/sql_parse.cc:6216
      #13 0x00005585949c2b31 in mysql_parse (thd=0x7f77b4000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.4/sql/sql_parse.cc:8010
      #14 0x00005585949c51ad in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f77b4000c58, packet=packet@entry=0x7f77b4007d69 "ALTER TABLE t ADD (x INT, y INT)", packet_length=packet_length@entry=32, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:1958
      #15 0x00005585949c752f in do_command (thd=0x7f77b4000c58) at /data/src/10.4/sql/sql_parse.cc:1378
      #16 0x0000558594ac0dbe in do_handle_one_connection (connect=connect@entry=0x558597751418) at /data/src/10.4/sql/sql_connect.cc:1420
      #17 0x0000558594ac0edd in handle_one_connection (arg=arg@entry=0x558597751418) at /data/src/10.4/sql/sql_connect.cc:1324
      #18 0x0000558594e53ffb in pfs_spawn_thread (arg=0x558597471288) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #19 0x00007f7806bc8fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #20 0x00007f7806c495bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            People

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