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

Assertion `index->table->persistent_autoinc' failed in btr_read_autoinc

    XMLWordPrintable

Details

    Description

      Setting to minor because I can only reproduce it on 10.2 debug builds. Please adjust accordingly if you find out that higher versions are affected.

      --source include/have_innodb.inc
       
      CREATE TABLE t (id INT AUTO_INCREMENT PRIMARY KEY, a VARCHAR(8), b INT, c INT AS (b), KEY(a,c)) ENGINE=InnoDB;
      INSERT INTO t (a) VALUES ('foo');
      UPDATE t SET a = 'bar';
       
      --source include/restart_mysqld.inc
      --sleep 1
       
      ALTER TABLE t ADD f INT;
       
      # Cleanup
      DROP TABLE t;
      

      10.2 e777645d

      mysqld: /data/src/10.2/storage/innobase/btr/btr0btr.cc:1342: ib_uint64_t btr_read_autoinc(dict_index_t*): Assertion `index->table->persistent_autoinc' failed.
      220215  2:31:45 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8855c23662 in __GI___assert_fail (assertion=0x5608984fb4a0 "index->table->persistent_autoinc", file=0x5608984fa578 "/data/src/10.2/storage/innobase/btr/btr0btr.cc", line=1342, function=0x5608984fb458 "ib_uint64_t btr_read_autoinc(dict_index_t*)") at assert.c:101
      #8  0x0000560897f574c2 in btr_read_autoinc (index=0x7f8820012a10) at /data/src/10.2/storage/innobase/btr/btr0btr.cc:1342
      #9  0x0000560897d815af in prepare_inplace_alter_table_dict (ha_alter_info=0x7f884bfb1070, altered_table=0x7f87f81339c0, old_table=0x7f882000c6d0, table_name=0x7f8820009e75 "t", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.2/storage/innobase/handler/handler0alter.cc:4982
      #10 0x0000560897d84dca in ha_innobase::prepare_inplace_alter_table (this=0x7f882000d2d8, altered_table=0x7f87f81339c0, ha_alter_info=0x7f884bfb1070) at /data/src/10.2/storage/innobase/handler/handler0alter.cc:6118
      #11 0x0000560897b53165 in handler::ha_prepare_inplace_alter_table (this=0x7f882000d2d8, altered_table=0x7f87f81339c0, ha_alter_info=0x7f884bfb1070) at /data/src/10.2/sql/handler.cc:4366
      #12 0x00005608979a031d in mysql_inplace_alter_table (thd=0x7f87f8000d90, table_list=0x7f87f80148d8, table=0x7f882000c6d0, altered_table=0x7f87f81339c0, ha_alter_info=0x7f884bfb1070, inplace_supported=HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, target_mdl_request=0x7f884bfb1100, alter_ctx=0x7f884bfb16b0) at /data/src/10.2/sql/sql_table.cc:7487
      #13 0x00005608979a6387 in mysql_alter_table (thd=0x7f87f8000d90, new_db=0x7f87f8014ef8 "test", new_name=0x0, create_info=0x7f884bfb22d0, table_list=0x7f87f80148d8, alter_info=0x7f884bfb2220, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9695
      #14 0x0000560897a236aa in Sql_cmd_alter_table::execute (this=0x7f87f8014fe8, thd=0x7f87f8000d90) at /data/src/10.2/sql/sql_alter.cc:333
      #15 0x00005608978d479d in mysql_execute_command (thd=0x7f87f8000d90) at /data/src/10.2/sql/sql_parse.cc:6017
      #16 0x00005608978d9532 in mysql_parse (thd=0x7f87f8000d90, rawbuf=0x7f87f8014808 "ALTER TABLE t ADD f INT", length=23, parser_state=0x7f884bfb35e0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7793
      #17 0x00005608978c78d5 in dispatch_command (command=COM_QUERY, thd=0x7f87f8000d90, packet=0x7f87f8008b61 "ALTER TABLE t ADD f INT", packet_length=23, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #18 0x00005608978c63ee in do_command (thd=0x7f87f8000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #19 0x0000560897a1e1d2 in do_handle_one_connection (connect=0x56089a78b730) at /data/src/10.2/sql/sql_connect.cc:1336
      #20 0x0000560897a1df46 in handle_one_connection (arg=0x56089a78b730) at /data/src/10.2/sql/sql_connect.cc:1241
      #21 0x0000560898226827 in pfs_spawn_thread (arg=0x56089a775a50) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #22 0x00007f88560e7ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #23 0x00007f8855cecdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      --sleep is somehow important. Also, while the test case fails for me every time, the presence of sleep indicates that it might be unstable on different machines and builds. Try to change it back and forth if the test doesn't fail for you.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.