mariadb/mysql-test/suite/innodb/t/innodb-autoinc-part.test
Marko Mäkelä 44a27a26e9 MDEV-28416 Incorrect AUTO_INCREMENT may be issued when close to UINT64_MAX
ha_innobase::get_auto_increment(): In the overflow check, account
for 64-bit unsigned integer wrap-around.

Based on mysql/mysql-server@25ecfe7f49
2022-04-27 08:08:06 +03:00

24 lines
599 B
Text

--source include/have_partition.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV-28416 Incorrect AUTO_INCREMENT may be issued
--echo #
SET @aii=@@auto_increment_increment;
SET auto_increment_increment=300;
CREATE TABLE t1 (a SERIAL) ENGINE=innodb
PARTITION BY RANGE (a) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (18446744073709551613);
SHOW CREATE TABLE t1;
--error HA_ERR_AUTOINC_ERANGE
INSERT INTO t1 VALUES (NULL);
SHOW CREATE TABLE t1;
DROP TABLE t1;
SET auto_increment_increment=@aii;
--echo # End of 10.2 tests