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

Assertion (o->ind == vers_start) upon inplace ALTER with virtual columns

    XMLWordPrintable

Details

    Description

      ./mtr  --mem TBR-1565
      ...
      CREATE TABLE B (
      pk INTEGER AUTO_INCREMENT,
      col_int_key INTEGER,
      col_varchar_key VARCHAR(1),
      o BIT, n BIT,
      h FLOAT AS ( n + 2 ) VIRTUAL,
      v BIT,
      PRIMARY KEY (pk),
      KEY (col_varchar_key, col_int_key)
      )  ENGINE = InnoDB;
      SET `system_versioning_alter_history`= KEEP ;
      ALTER TABLE `B` ADD SYSTEM VERSIONING ;
      ALTER        TABLE `B` ADD COLUMN IF NOT EXISTS ( w BIT, v SERIAL ) ;
      Warnings:
      Note    1060    Duplicate column name 'v'
      ALTER        TABLE `B` ADD COLUMN IF NOT EXISTS ( p BIT ) ;
      ERROR HY000: Lost connection to server during query
      DROP TABLE `B`;
      ERROR HY000: Server has gone away
      ...
      mariadbd: /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:529: bool dict_table_t::instant_column(const dict_table_t&, const ulint*): Assertion `o->ind == vers_start' failed.
      ...
      (rr) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00007f96cc83e859 in __GI_abort () at abort.c:79
      #2  0x00007f96cc83e729 in __assert_fail_base (fmt=0x7f96cc9d4588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55940fe144c0 "o->ind == vers_start", 
          file=0x55940fe12900 "/data/Server/10.8G/storage/innobase/handler/handler0alter.cc", line=529, function=<optimized out>) at assert.c:92
      #3  0x00007f96cc84ff36 in __GI___assert_fail (assertion=0x55940fe144c0 "o->ind == vers_start", file=0x55940fe12900 "/data/Server/10.8G/storage/innobase/handler/handler0alter.cc", line=529, 
          function=0x55940fe14000 "bool dict_table_t::instant_column(const dict_table_t&, const ulint*)") at assert.c:101
      #4  0x000055940ea1d36f in dict_table_t::instant_column (this=0x618000067908, table=..., col_map=0x61d0002dd6c0) at /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:529
      #5  0x000055940ea25067 in ha_innobase_inplace_ctx::instant_column (this=0x6290000fd610) at /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:1177
      #6  0x000055940e9d9925 in innobase_instant_try (ha_alter_info=0x7f96c07b2b00, ctx=0x6290000fd610, altered_table=0x7f96c07b3200, table=0x6190000d8e98, trx=0x7f96c8a83e40)
          at /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:5739
      #7  0x000055940ea2f0fb in commit_try_norebuild (ha_alter_info=0x7f96c07b2b00, ctx=0x6290000fd610, altered_table=0x7f96c07b3200, old_table=0x6190000d8e98, trx=0x7f96c8a83e40, table_name=0x61b00003b05d "B")
          at /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:10474
      #8  0x000055940ea074f7 in ha_innobase::commit_inplace_alter_table (this=0x61d0002d64b8, altered_table=0x7f96c07b3200, ha_alter_info=0x7f96c07b2b00, commit=true)
          at /data/Server/10.8G/storage/innobase/handler/handler0alter.cc:11222
      #9  0x000055940e0b50aa in handler::ha_commit_inplace_alter_table (this=0x61d0002d64b8, altered_table=0x7f96c07b3200, ha_alter_info=0x7f96c07b2b00, commit=true) at /data/Server/10.8G/sql/handler.cc:5219
      #10 0x000055940db128d8 in mysql_inplace_alter_table (thd=0x62b00016c218, table_list=0x6290000fa390, table=0x6190000d8e98, altered_table=0x7f96c07b3200, ha_alter_info=0x7f96c07b2b00, target_mdl_request=0x7f96c07b2c00, 
          ddl_log_state=0x7f96c07b2920, trigger_param=0x7f96c07b3640, alter_ctx=0x7f96c07b40a0, partial_alter=@0x7f96c07b2690: false, start_alter_id=@0x7f96c07b26c0: 0, if_exists=false) at /data/Server/10.8G/sql/sql_table.cc:7733
      #11 0x000055940db27832 in mysql_alter_table (thd=0x62b00016c218, new_db=0x62b000170cc0, new_name=0x62b0001710d8, create_info=0x7f96c07b5550, table_list=0x6290000fa390, alter_info=0x7f96c07b5420, order_num=0, order=0x0, 
          ignore=false, if_exists=false) at /data/Server/10.8G/sql/sql_table.cc:10701
      #12 0x000055940dcb782c in Sql_cmd_alter_table::execute (this=0x6290000fabb0, thd=0x62b00016c218) at /data/Server/10.8G/sql/sql_alter.cc:547
      #13 0x000055940d87df76 in mysql_execute_command (thd=0x62b00016c218, is_called_from_prepared_stmt=false) at /data/Server/10.8G/sql/sql_parse.cc:5988
      #14 0x000055940d88a397 in mysql_parse (thd=0x62b00016c218, rawbuf=0x6290000fa238 "ALTER        TABLE `B` ADD COLUMN IF NOT EXISTS ( p BIT )", length=57, parser_state=0x7f96c07b6a20) at /data/Server/10.8G/sql/sql_parse.cc:8027
      #15 0x000055940d8627e9 in dispatch_command (command=COM_QUERY, thd=0x62b00016c218, packet=0x62900026c219 "ALTER        TABLE `B` ADD COLUMN IF NOT EXISTS ( p BIT ) ", packet_length=58, blocking=true)
          at /data/Server/10.8G/sql/sql_parse.cc:1894
      #16 0x000055940d85fc30 in do_command (thd=0x62b00016c218, blocking=true) at /data/Server/10.8G/sql/sql_parse.cc:1407
      #17 0x000055940dc9d5e5 in do_handle_one_connection (connect=0x608000002a38, put_in_cache=true) at /data/Server/10.8G/sql/sql_connect.cc:1418
      #18 0x000055940dc9ce71 in handle_one_connection (arg=0x6080000029b8) at /data/Server/10.8G/sql/sql_connect.cc:1312
      #19 0x00007f96ccd68609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x00007f96cc93b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      (rr)
       
      In case I use the storage engine 'Aria' than the test passes.
       
      commit 155019b96b9c98228ddbe87ef0c82c24cda3f474 (HEAD, origin/10.8)
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              mleich Matthias Leich
              Votes:
              1 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.