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?
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?