Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

AUTO_INCREMENT when column maximum is reached (1 reply)

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

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>