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

Assertion `auto_increment_value' failed in ha_partition::info upon UPDATE with partition pruning

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (a INT) PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (1), PARTITION p1 VALUES LESS THAN (MAXVALUE));
      INSERT INTO t1 VALUES (1),(2);
      ALTER TABLE t1 MODIFY a INT AUTO_INCREMENT PRIMARY KEY;
      UPDATE t1 PARTITION (p1) SET a=9 ORDER BY a LIMIT 1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 352e7667

      mysqld: /data/src/10.3/sql/ha_partition.cc:8190: virtual int ha_partition::info(uint): Assertion `auto_increment_value' failed.
      191108  2:54:29 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f67b2f31f12 in __GI___assert_fail (assertion=0x5566f0fa9739 "auto_increment_value", file=0x5566f0fa6e20 "/data/src/10.3/sql/ha_partition.cc", line=8190, function=0x5566f0fab860 <ha_partition::info(unsigned int)::__PRETTY_FUNCTION__> "virtual int ha_partition::info(uint)") at assert.c:101
      #8  0x00005566f0b441c2 in ha_partition::info (this=0x7f679c095d38, flag=64) at /data/src/10.3/sql/ha_partition.cc:8190
      #9  0x00005566f0b48ff7 in ha_partition::update_next_auto_inc_val (this=0x7f679c095d38) at /data/src/10.3/sql/ha_partition.cc:10357
      #10 0x00005566f0b39695 in ha_partition::update_row (this=0x7f679c095d38, old_data=0x7f679c16de90 "\377\001", new_data=0x7f679c16de88 "\377\t") at /data/src/10.3/sql/ha_partition.cc:4474
      #11 0x00005566f031e516 in handler::ha_update_row (this=0x7f679c095d38, old_data=0x7f679c16de90 "\377\001", new_data=0x7f679c16de88 "\377\t") at /data/src/10.3/sql/handler.cc:6478
      #12 0x00005566f00fa8f8 in mysql_update (thd=0x7f679c000af0, table_list=0x7f679c012970, fields=..., values=..., conds=0x0, order_num=1, order=0x7f679c0132c0, limit=1, ignore=false, found_return=0x7f67ad12ff10, updated_return=0x7f67ad12ffd0) at /data/src/10.3/sql/sql_update.cc:954
      #13 0x00005566efff755b in mysql_execute_command (thd=0x7f679c000af0) at /data/src/10.3/sql/sql_parse.cc:4301
      #14 0x00005566f0003597 in mysql_parse (thd=0x7f679c000af0, rawbuf=0x7f679c012808 "UPDATE t1 PARTITION (p1) SET a=9 ORDER BY a LIMIT 1", length=51, parser_state=0x7f67ad1305e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7815
      #15 0x00005566efff011b in dispatch_command (command=COM_QUERY, thd=0x7f679c000af0, packet=0x7f679c008c61 "UPDATE t1 PARTITION (p1) SET a=9 ORDER BY a LIMIT 1", packet_length=51, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #16 0x00005566effeea63 in do_command (thd=0x7f679c000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #17 0x00005566f0165bea in do_handle_one_connection (connect=0x5566f29cf340) at /data/src/10.3/sql/sql_connect.cc:1403
      #18 0x00005566f016594c in handle_one_connection (arg=0x5566f29cf340) at /data/src/10.3/sql/sql_connect.cc:1308
      #19 0x00005566f0b14718 in pfs_spawn_thread (arg=0x5566f29ea300) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #20 0x00007f67b4aa74a4 in start_thread (arg=0x7f67ad131700) at pthread_create.c:456
      #21 0x00007f67b2feed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible with at least InnoDB and MyISAM on 10.3-10.4.
      Not reproducible on 10.2.
      No obvious effect on a non-debug build.

      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.
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              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.