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
943
September 03, 2020 10:48AM
414
September 03, 2020 11:54AM
383
September 04, 2020 06:22AM
381
September 04, 2020 10:28AM
370
September 04, 2020 10:33AM
358
September 04, 2020 03:29PM
Sorry, you can't reply to this topic. It has been closed.
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.