MySQL Forums
Forum List  »  InnoDB

AUTO_INCREMENT when column maximum is reached
Posted by: Larry Menard
Date: September 03, 2020 10:48AM

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?

Options: ReplyQuote


Subject
Views
Written By
Posted
AUTO_INCREMENT when column maximum is reached
159
September 03, 2020 10:48AM


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.