Bug #1837 Explicitly setting auto-increment int key to -1 causes error
Submitted: 14 Nov 2003 8:27 Modified: 14 Nov 2003 10:22
Reporter: Barry Byrne Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:server version: 3.23.54 OS:Solaris (Solaris, Linux)
Assigned to: Dean Ellis CPU Architecture:Any

[14 Nov 2003 8:27] Barry Byrne
Description:
I have a table with 
 uid   | int(11)              |      | PRI | NULL           | auto_increment 
after 378 entries
I inserted
INSERT into table_name SET uid=-1,....;

The next (auto-incremented) entry had uid equal to 2147483647.

I would have thought -1 was less than 378....

How to repeat:
have table with 
 uid   | int(11)              |      | PRI | NULL           | auto_increment
 
INSERT into table_name SET uid=-1,....;

Suggested fix:
Delete entry, dump table and reload it    (extreme!)
[14 Nov 2003 10:22] Dean Ellis
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

This behaviour is described in the CREATE TABLE Syntax chapter of the manual.

Thank you.