Bug #1785 | AUTO_INCREMENT fields don't work on InnoDB | ||
---|---|---|---|
Submitted: | 9 Nov 2003 11:03 | Modified: | 9 Nov 2003 19:41 |
Reporter: | Jeremy Perkins | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
Version: | 4.0.16 | OS: | Windows (Windows) |
Assigned to: | CPU Architecture: | Any |
[9 Nov 2003 11:03]
Jeremy Perkins
[9 Nov 2003 19:41]
Paul DuBois
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 is a consequence of the way AUTO_INCREMENT is incremented in InnoDB. See: http://www.mysql.com/doc/en/InnoDB_auto-increment_column.html
[10 Nov 2003 10:09]
Jeremy Perkins
OK, now I read section 7.5.12.5 of the manual (which has only recently been added and so does not appear in the book) I can see that this is a design "feature" rather than a bug. However, please be aware that you need to change 6.5.3 of the manual which currently incorrectly states that if you delete the row containing the maximum value for an AUTO_INCREMENT column, the value will not be reused for an InnoDB table. I would also say this is potentially a major "Gotcha!" that in some cases makes AUTO_INCREMENT columns unusable in InnoDB. In my case it certainly does, and in fact because MyISAM tables aren't transaction-safe I'm now not sure that I can use MySQL atall.
[10 Nov 2003 10:55]
Jeremy Perkins
I beg your pardon - section 7.5.12.5 is in the book! However despite that I still stand by the rest of what I wrote!