summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-06-22 00:56:16 +0900
committerNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-06-28 01:48:55 +0900
commit5375f0b495b69dbd6e1d5558ace6ce0fcd9cc636 (patch)
tree5fb7b87dc6725e591bafb0ac06895348508388e4 /storage
parentf339ef3f9793d5de8f825f1ec6489550b98e7e9a (diff)
downloadmariadb-git-5375f0b495b69dbd6e1d5558ace6ce0fcd9cc636.tar.gz
MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table | Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
The bug is caused by a similar mechanism as MDEV-21027. The function, check_insert_or_replace_autoincrement, failed to open all the partitions on INSERT SELECT statements and it results in the assertion error.
Diffstat (limited to 'storage')
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result12
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
index 9b79cc21875..249a27ce274 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
@@ -1115,11 +1115,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+##############################################################################
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='TokuDB' PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
@@ -1130,5 +1131,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='TokuDB' PARTITION BY HASH (a) PARTITIONS 3;
REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
-##############################################################################
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='TokuDB' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved;