summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorShunsuke Tokunaga <tkngsnsk313320@gmail.com>2022-06-16 13:28:24 +0900
committerGitHub <noreply@github.com>2022-06-16 13:28:24 +0900
commitc4f65d8fed16370deae85115490fc0c06da2ce84 (patch)
treec61e321ea34d38fd875a4c0e4eb5ec5388b9b7c6 /storage
parentf31e935c3e0649d36008ab440cd87cb7ff474bb3 (diff)
downloadmariadb-git-c4f65d8fed16370deae85115490fc0c06da2ce84.tar.gz
MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher
ha_partition::set_auto_increment_if_higher expects part_share->auto_inc_initialized is true or can_use_for_auto_inc_init() is false (but as the comment of this method says, it returns false only if we use Spider engine with DROP TABLE or ALTER TABLE query). However, part_share->auto_inc_initialized becomes true only after all partitions are opened (since 6dce6aecebe6ef78a14cb5c5c5daa8a355551e40). Therefore, I added a conditional expression in order to read all partitions when we execute REPLACE on a table that has an AUTO_INCREMENT column. Reviewed by: Nayuta Yanagisawa Reviewed by: Alexey Botchkov
Diffstat (limited to 'storage')
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result7
1 files changed, 7 insertions, 0 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 14b6052a7d3..9b79cc21875 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
@@ -1123,5 +1123,12 @@ CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
+#
+# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
+# ha_partition::set_auto_increment_if_higher
+#
+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;
##############################################################################
SET GLOBAL tokudb_prelock_empty = @tokudb_prelock_empty_saved;