AUTO_INCREMENT when column maximum is reached
I think I'm not doing anything wrong, but I'm seeing what looks like a problem when an AUTO_INCREMENT column reaches its max, only when using the InnoDB engine (with MyISAM engine it behaves correctly).
Very simple repro script:
DROP TABLE IF EXISTS testtable;
CREATE TABLE testtable (
id int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=2147483645;
-- Insert a row that should have an id of 2147483645
INSERT INTO testtable VALUES();
-- Insert a row that should have an id of 2147483646
INSERT INTO testtable VALUES();
-- Query the table
SELECT * FROM testtable;
-- should contain:
-- 2147483645
-- 2147483646
-- actually contains:
-- 2147483645
-- 2147483647
-- where is 2147483646?
Am I missing something?
Subject
Views
Written By
Posted
AUTO_INCREMENT when column maximum is reached
245
September 03, 2020 10:48AM
107
September 03, 2020 11:54AM
108
September 04, 2020 06:22AM
98
September 04, 2020 10:28AM
100
September 04, 2020 10:33AM
92
September 04, 2020 03:29PM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.