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

Assertion `index->n_fields >= n_core' failed in rec_init_offsets_comp_ordinary upon adding virtual column after dropping base columns

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT, b INT, c INT, d INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1,2,3,4),(5,6,7,8);
       
      ALTER TABLE t1 DROP COLUMN c;
      ALTER TABLE t1 DROP COLUMN b;
      ALTER TABLE t1 ADD v INT AS (a);
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 2465d3e00b

      mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:295: void rec_init_offsets_comp_ordinary(const rec_t*, const dict_index_t*, ulint*, ulint, const dict_col_t::def_t*, rec_leaf_format) [with bool mblob = true; rec_t = unsigned char; ulint = long unsigned int]: Assertion `index->n_fields >= n_core' failed.
      190107 15:57:19 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f9fd49e7ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055c7ea276b7f in rec_init_offsets_comp_ordinary<true> (rec=0x7f9fce4f40d1 "", index=0x7f9f7c07f1d8, offsets=0x7f9f7c00adf8, n_core=7, def_val=0x0, format=REC_LEAF_INSTANT) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:295
      #9  0x000055c7ea2716c4 in rec_get_offsets_func (rec=0x7f9fce4f40d1 "", index=0x7f9f7c07f1d8, offsets=0x7f9f7c00adf8, leaf=true, n_fields=18446744073709551615, file=0x55c7ea9bbb80 "/data/src/10.4/storage/innobase/btr/btr0cur.cc", line=547, heap=0x7f9fcdd26f70) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:925
      #10 0x000055c7ea3acb73 in btr_cur_instant_init_low (index=0x7f9f7c07f1d8, mtr=0x7f9fcdd27220) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:546
      #11 0x000055c7ea3ad01c in btr_cur_instant_init (table=0x7f9f7c00e9f8) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:616
      #12 0x000055c7ea45583e in dict_load_table_one (name=..., cached=true, ignore_err=DICT_ERR_IGNORE_NONE, fk_tables=std::deque with 0 elements) at /data/src/10.4/storage/innobase/dict/dict0load.cc:3014
      #13 0x000055c7ea454959 in dict_load_table (name=0x7f9fcdd28940 "test/t1", cached=true, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.4/storage/innobase/dict/dict0load.cc:2766
      #14 0x000055c7ea43643a in dict_table_open_on_name (table_name=0x7f9fcdd28940 "test/t1", dict_locked=1, try_drop=1, ignore_err=DICT_ERR_IGNORE_NONE) at /data/src/10.4/storage/innobase/dict/dict0dict.cc:1185
      #15 0x000055c7ea1a1c82 in ha_innobase::commit_inplace_alter_table (this=0x7f9f7c07c738, altered_table=0x7f9f7c133b60, ha_alter_info=0x7f9fcdd29bc0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:11065
      #16 0x000055c7e9e311ec in handler::ha_commit_inplace_alter_table (this=0x7f9f7c07c738, altered_table=0x7f9f7c133b60, ha_alter_info=0x7f9fcdd29bc0, commit=true) at /data/src/10.4/sql/handler.cc:4492
      #17 0x000055c7e9bf0b94 in mysql_inplace_alter_table (thd=0x7f9f7c000b00, table_list=0x7f9f7c015080, table=0x7f9f7c072790, altered_table=0x7f9f7c133b60, ha_alter_info=0x7f9fcdd29bc0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f9fcdd29cf0, alter_ctx=0x7f9fcdd2a8e0) at /data/src/10.4/sql/sql_table.cc:7590
      #18 0x000055c7e9bf69f5 in mysql_alter_table (thd=0x7f9f7c000b00, new_db=0x7f9f7c0051c8, new_name=0x7f9f7c005598, create_info=0x7f9fcdd2b4d0, table_list=0x7f9f7c015080, alter_info=0x7f9fcdd2b410, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9690
      #19 0x000055c7e9c81077 in Sql_cmd_alter_table::execute (this=0x7f9f7c015920, thd=0x7f9f7c000b00) at /data/src/10.4/sql/sql_alter.cc:497
      #20 0x000055c7e9b1e319 in mysql_execute_command (thd=0x7f9f7c000b00) at /data/src/10.4/sql/sql_parse.cc:6302
      #21 0x000055c7e9b23244 in mysql_parse (thd=0x7f9f7c000b00, rawbuf=0x7f9f7c014f98 "ALTER TABLE t1 ADD v INT AS (a)", length=31, parser_state=0x7f9fcdd2c600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8104
      #22 0x000055c7e9b1046e in dispatch_command (command=COM_QUERY, thd=0x7f9f7c000b00, packet=0x7f9f7c137fd1 "ALTER TABLE t1 ADD v INT AS (a)", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #23 0x000055c7e9b0ee92 in do_command (thd=0x7f9f7c000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #24 0x000055c7e9c7b0ba in do_handle_one_connection (connect=0x55c7ec90e4c0) at /data/src/10.4/sql/sql_connect.cc:1402
      #25 0x000055c7e9c7ae3e in handle_one_connection (arg=0x55c7ec90e4c0) at /data/src/10.4/sql/sql_connect.cc:1308
      #26 0x000055c7ea13a164 in pfs_spawn_thread (arg=0x55c7ec909460) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #27 0x00007f9fd64a3494 in start_thread (arg=0x7f9fcdd2d700) at pthread_create.c:333
      #28 0x00007f9fd4aa493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.3.
      No visible effect on a non-debug build.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration