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

Assertion `n_fields > n_cols' failed in dict_index_t::init_change_cols

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (a VARCHAR(16) COLLATE utf8_bin, FULLTEXT (a)) ENGINE=InnoDB COLLATE utf8_unicode_520_ci;
      ALTER TABLE t MODIFY COLUMN a VARCHAR(512);
       
      # Cleanup
      DROP TABLE t;
      

      10.6 39cafb66

      mariadbd: /data/src/10.6/storage/innobase/include/dict0mem.h:1348: void dict_index_t::init_change_cols(unsigned int): Assertion `n_fields > n_cols' failed.
      220816 17:22:34 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fa9b97e3662 in __GI___assert_fail (assertion=0x562bd1de7852 "n_fields > n_cols", file=0x562bd1de73f8 "/data/src/10.10/storage/innobase/include/dict0mem.h", line=1339, function=0x562bd1de7868 "void dict_index_t::init_change_cols(unsigned int)") at assert.c:101
      #8  0x0000562bd154f4e1 in dict_index_t::init_change_cols (this=0x7fa96c11fc08, n_cols=1) at /data/src/10.10/storage/innobase/include/dict0mem.h:1339
      #9  0x0000562bd155a1b4 in ha_innobase_inplace_ctx::change_col_collation (this=0x7fa96c016b40, index=0x7fa96c11fc08, altered_table=...) at /data/src/10.10/storage/innobase/handler/handler0alter.cc:1430
      #10 0x0000562bd153e7b5 in prepare_inplace_alter_table_dict (ha_alter_info=0x7fa9ac5550d0, altered_table=0x7fa9ac555190, old_table=0x7fa96c042ef8, table_name=0x7fa96c22624d "t", flags=33, flags2=84, fts_doc_id_col=1, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.10/storage/innobase/handler/handler0alter.cc:7200
      #11 0x0000562bd15447d6 in ha_innobase::prepare_inplace_alter_table (this=0x7fa96c11a970, altered_table=0x7fa9ac555190, ha_alter_info=0x7fa9ac5550d0) at /data/src/10.10/storage/innobase/handler/handler0alter.cc:8492
      #12 0x0000562bd1117bfa in handler::ha_prepare_inplace_alter_table (this=0x7fa96c11a970, altered_table=0x7fa9ac555190, ha_alter_info=0x7fa9ac5550d0) at /data/src/10.10/sql/handler.cc:5215
      #13 0x0000562bd0e64828 in mysql_inplace_alter_table (thd=0x7fa96c000db8, table_list=0x7fa96c015570, table=0x7fa96c042ef8, altered_table=0x7fa9ac555190, ha_alter_info=0x7fa9ac5550d0, target_mdl_request=0x7fa9ac555960, ddl_log_state=0x7fa9ac555070, trigger_param=0x7fa9ac555550, alter_ctx=0x7fa9ac5564d0, partial_alter=@0x7fa9ac554f76: false, start_alter_id=@0x7fa9ac554fb0: 0, if_exists=false) at /data/src/10.10/sql/sql_table.cc:7612
      #14 0x0000562bd0e6e124 in mysql_alter_table (thd=0x7fa96c000db8, new_db=0x7fa96c005a90, new_name=0x7fa96c005ea0, create_info=0x7fa9ac5572e0, table_list=0x7fa96c015570, alter_info=0x7fa9ac5571f0, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.10/sql/sql_table.cc:10704
      #15 0x0000562bd0f24306 in Sql_cmd_alter_table::execute (this=0x7fa96c015d80, thd=0x7fa96c000db8) at /data/src/10.10/sql/sql_alter.cc:547
      #16 0x0000562bd0d4f185 in mysql_execute_command (thd=0x7fa96c000db8, is_called_from_prepared_stmt=false) at /data/src/10.10/sql/sql_parse.cc:5997
      #17 0x0000562bd0d55227 in mysql_parse (thd=0x7fa96c000db8, rawbuf=0x7fa96c015470 "ALTER TABLE t MODIFY COLUMN a VARCHAR(512)", length=42, parser_state=0x7fa9ac5583c0) at /data/src/10.10/sql/sql_parse.cc:8035
      #18 0x0000562bd0d41807 in dispatch_command (command=COM_QUERY, thd=0x7fa96c000db8, packet=0x7fa96c00b9f9 "ALTER TABLE t MODIFY COLUMN a VARCHAR(512)", packet_length=42, blocking=true) at /data/src/10.10/sql/sql_parse.cc:1894
      #19 0x0000562bd0d40202 in do_command (thd=0x7fa96c000db8, blocking=true) at /data/src/10.10/sql/sql_parse.cc:1407
      #20 0x0000562bd0f1905a in do_handle_one_connection (connect=0x562bd4c98388, put_in_cache=true) at /data/src/10.10/sql/sql_connect.cc:1418
      #21 0x0000562bd0f18cf9 in handle_one_connection (arg=0x562bd4cadc08) at /data/src/10.10/sql/sql_connect.cc:1312
      #22 0x0000562bd1418972 in pfs_spawn_thread (arg=0x562bd4c97ef8) at /data/src/10.10/storage/perfschema/pfs.cc:2201
      #23 0x00007fa9b9cadea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #24 0x00007fa9b98acdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure started happening on 10.6 after this commit:

      commit f8240a2723f0cad948a02fc5381f050d02e45e95
      Author: Marko Mäkelä
      Date:   Mon Jul 4 11:15:15 2022 +0300
       
          MDEV-26294 Duplicate entries in unique index not detected when changing collation
      

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.