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

Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher

    XMLWordPrintable

    Details

      Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY HASH (a) PARTITIONS 3;
      REPLACE INTO t1 PARTITION (p0) VALUES (3),(8);
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 c4ee8a30

      mysqld: /data/src/10.3/sql/ha_partition.h:1325: virtual void ha_partition::set_auto_increment_if_higher(Field*): Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
      191111 16:17:15 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f16c2796f12 in __GI___assert_fail (assertion=0x55f18cc42d88 "part_share->auto_inc_initialized || !can_use_for_auto_inc_init()", file=0x55f18cc42d18 "/data/src/10.3/sql/ha_partition.h", line=1325, function=0x55f18cc48020 <ha_partition::set_auto_increment_if_higher(Field*)::__PRETTY_FUNCTION__> "virtual void ha_partition::set_auto_increment_if_higher(Field*)") at assert.c:101
      #8  0x000055f18c7e9387 in ha_partition::set_auto_increment_if_higher (this=0x7f16ac0963f8, field=0x7f16ac1219c0) at /data/src/10.3/sql/ha_partition.h:1324
      #9  0x000055f18c7d4fab in ha_partition::write_row (this=0x7f16ac0963f8, buf=0x7f16ac1219a0 "\377\003") at /data/src/10.3/sql/ha_partition.cc:4339
      #10 0x000055f18bfba10c in handler::ha_write_row (this=0x7f16ac0963f8, buf=0x7f16ac1219a0 "\377\003") at /data/src/10.3/sql/handler.cc:6446
      #11 0x000055f18bc520dc in write_record (thd=0x7f16ac000af0, table=0x7f16ac0957b0, info=0x7f16bc994bb0) at /data/src/10.3/sql/sql_insert.cc:1706
      #12 0x000055f18bc50402 in mysql_insert (thd=0x7f16ac000af0, table_list=0x7f16ac012960, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false) at /data/src/10.3/sql/sql_insert.cc:1072
      #13 0x000055f18bc93ccb in mysql_execute_command (thd=0x7f16ac000af0) at /data/src/10.3/sql/sql_parse.cc:4455
      #14 0x000055f18bc9f597 in mysql_parse (thd=0x7f16ac000af0, rawbuf=0x7f16ac012808 "REPLACE INTO t1 PARTITION (p0) VALUES (3),(8)", length=45, parser_state=0x7f16bc9955e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7815
      #15 0x000055f18bc8c11b in dispatch_command (command=COM_QUERY, thd=0x7f16ac000af0, packet=0x7f16ac008c61 "REPLACE INTO t1 PARTITION (p0) VALUES (3),(8)", packet_length=45, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #16 0x000055f18bc8aa63 in do_command (thd=0x7f16ac000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #17 0x000055f18be01bea in do_handle_one_connection (connect=0x55f18eb7a490) at /data/src/10.3/sql/sql_connect.cc:1403
      #18 0x000055f18be0194c in handle_one_connection (arg=0x55f18eb7a490) at /data/src/10.3/sql/sql_connect.cc:1308
      #19 0x000055f18c7b0718 in pfs_spawn_thread (arg=0x55f18eb95550) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #20 0x00007f16c430c4a4 in start_thread (arg=0x7f16bc996700) at pthread_create.c:456
      #21 0x00007f16c2853d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible with at least InnoDB, MyISAM and Aria on 10.3-10.5.
      Not reproducible on 10.2.

      The failure appeared in 10.3 after this commit:

      commit 6dce6aecebe6ef78a14cb5c5c5daa8a355551e40
      Author: Alexey Botchkov <holyfoot@askmonty.org>
      Date:   Fri Nov 1 09:39:43 2019 +0400
       
          MDEV-18244 Server crashes in ha_innobase::update_thd / ... / ha_partition::update_next_auto_inc_val.
      

      Non-debug version returns an error (before and after the patch above):

      CURRENT_TEST: bug.autoinc3
      mysqltest: At line 4: query 'REPLACE INTO t1 PARTITION (p0) VALUES (3),(8)' failed: 1748: Found a row not matching the given partition set
      

      which is probably expected.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: