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

Assertion `ha_alter_info->key_count + (dict_table_get_first_index(ctx->new_table))->is_gen_clust() + .... in bool prepare_inplace_alter_table_dict

    XMLWordPrintable

Details

    Description

      CREATE TABLE t0(a INT KEY,b TEXT,FTS_DOC_ID BIGINT UNSIGNED NOT NULL,KEY FTS_DOC_ID_INDEX(FTS_DOC_ID));
      ALTER TABLE t0 ADD COLUMN d TEXT GENERATED ALWAYS AS(SUBSTR(b,0,0)) FIRST;
      ALTER TABLE t0 ADD c0 BLOB NULL;
      

      Leads to:

      10.9.2 6ec17142dcfb1e9d9f41211ed1b6d82e062d1541 (Debug)

      mysqld: /test/10.9_dbg/storage/innobase/handler/handler0alter.cc:6720: bool prepare_inplace_alter_table_dict(Alter_inplace_info*, const TABLE*, const TABLE*, const char*, ulint, ulint, ulint, bool, bool): Assertion `ha_alter_info->key_count + (dict_table_get_first_index(ctx->new_table))->is_gen_clust() + (ctx->old_table->fts_doc_id_index && innobase_fts_check_doc_id_index_in_def( altered_table->s->keys, altered_table->key_info) != FTS_EXIST_DOC_ID_INDEX) == ctx->num_to_add_index' failed.
      

      10.9.2 6ec17142dcfb1e9d9f41211ed1b6d82e062d1541 (Debug)

      Core was generated by `/test/MD280522-mariadb-10.9.2-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x150df096e700 (LWP 277982))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000150e0930e859 in __GI_abort () at abort.c:79
      #2  0x0000150e0930e729 in __assert_fail_base (fmt=0x150e094a4588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5579c7fe04c0 "ha_alter_info->key_count + (dict_table_get_first_index(ctx->new_table))->is_gen_clust() + (ctx->old_table->fts_doc_id_index && innobase_fts_check_doc_id_index_in_def( altered_table->s->keys, altered_t"..., file=0x5579c7fdd9f0 "/test/10.9_dbg/storage/innobase/handler/handler0alter.cc", line=6720, function=<optimized out>) at assert.c:92
      #3  0x0000150e0931ff36 in __GI___assert_fail (assertion=assertion@entry=0x5579c7fe04c0 "ha_alter_info->key_count + (dict_table_get_first_index(ctx->new_table))->is_gen_clust() + (ctx->old_table->fts_doc_id_index && innobase_fts_check_doc_id_index_in_def( altered_table->s->keys, altered_t"..., file=file@entry=0x5579c7fdd9f0 "/test/10.9_dbg/storage/innobase/handler/handler0alter.cc", line=line@entry=6720, function=function@entry=0x5579c7fdf568 "bool prepare_inplace_alter_table_dict(Alter_inplace_info*, const TABLE*, const TABLE*, const char*, ulint, ulint, ulint, bool, bool)") at assert.c:101
      #4  0x00005579c77f20d9 in prepare_inplace_alter_table_dict (ha_alter_info=ha_alter_info@entry=0x150df0969ff0, altered_table=altered_table@entry=0x150df096a0b0, old_table=<optimized out>, table_name=<optimized out>, flags=<optimized out>, flags2=<optimized out>, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /test/10.9_dbg/storage/innobase/include/dict0mem.h:1164
      #5  0x00005579c77f95f0 in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>) at /test/10.9_dbg/storage/innobase/handler/ha_innodb.h:700
      #6  0x00005579c74add83 in handler::ha_prepare_inplace_alter_table (this=0x150dbc038b60, altered_table=altered_table@entry=0x150df096a0b0, ha_alter_info=ha_alter_info@entry=0x150df0969ff0) at /test/10.9_dbg/sql/handler.cc:5200
      #7  0x00005579c728f499 in mysql_inplace_alter_table (thd=thd@entry=0x150dbc000db8, table_list=0x150dbc013d00, table=table@entry=0x150dbc01e238, altered_table=altered_table@entry=0x150df096a0b0, ha_alter_info=ha_alter_info@entry=0x150df0969ff0, target_mdl_request=target_mdl_request@entry=0x150df096a880, ddl_log_state=0x150df0969f80, trigger_param=0x150df096a470, alter_ctx=0x150df096b730, partial_alter=@0x150df0969eef: false, start_alter_id=@0x150df0969ef8: 0, if_exists=false) at /test/10.9_dbg/sql/sql_table.cc:7614
      #8  0x00005579c72a27df in mysql_alter_table (thd=thd@entry=0x150dbc000db8, new_db=new_db@entry=0x150dbc005878, new_name=new_name@entry=0x150dbc005c88, create_info=create_info@entry=0x150df096c540, table_list=<optimized out>, table_list@entry=0x150dbc013d00, alter_info=alter_info@entry=0x150df096c450, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/10.9_dbg/sql/sql_table.cc:10706
      #9  0x00005579c7328130 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x150dbc000db8) at /test/10.9_dbg/sql/structs.h:569
      #10 0x00005579c71c956c in mysql_execute_command (thd=thd@entry=0x150dbc000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:5996
      #11 0x00005579c71b1bca in mysql_parse (thd=thd@entry=0x150dbc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150df096d470) at /test/10.9_dbg/sql/sql_parse.cc:8036
      #12 0x00005579c71bf198 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150dbc000db8, packet=packet@entry=0x150dbc00b6c9 "ALTER TABLE t0 ADD c0 BLOB NULL", packet_length=packet_length@entry=31, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364
      #13 0x00005579c71c18a0 in do_command (thd=0x150dbc000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1407
      #14 0x00005579c7320d88 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5579ca4243a8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
      #15 0x00005579c7321291 in handle_one_connection (arg=0x5579ca4243a8) at /test/10.9_dbg/sql/sql_connect.cc:1312
      #16 0x0000150e0981d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #17 0x0000150e0940b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.36 (dbg), 10.4.26 (dbg), 10.5.17 (dbg), 10.6.9 (dbg), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (opt), 10.4.25 (opt), 10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt)

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.