1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-32008 auto_increment value on table increments by one after restart

- This issue caused by commit 4700f2ac70f8c79f2ac1968b6b59d18716f492bf(MDEV-30796)
During bulk insert operation, InnoDB wrongly stores the next autoincrement
value as current autoincrement value. So update the current autoincrement
value rather than next auto increment value.
This commit is contained in:
Thirunarayanan Balathandayuthapani
2023-08-29 10:37:08 +05:30
parent cd5808eb8d
commit cb384d0d04
3 changed files with 19 additions and 1 deletions

View File

@ -42,6 +42,7 @@ DROP DATABASE db1;
--echo # End of 10.6 tests
--echo #
SET foreign_key_checks=0, unique_checks=0;
--echo #
--echo # MDEV-30796 Auto_increment values not updated after bulk
--echo # insert operation
@ -49,7 +50,9 @@ DROP DATABASE db1;
CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT,
f2 INT NOT NULL, PRIMARY KEY(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 2), (25, 3), (2, 4);
SHOW CREATE TABLE t1;
--source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
INSERT INTO t1(f2) VALUES(5);
SELECT max(f1) FROM t1;
DROP TABLE t1;