Bug #55140 | Autoincrement increases on failed query with contraints... | ||
---|---|---|---|
Submitted: | 9 Jul 2010 22:53 | Modified: | 10 Jul 2010 6:06 |
Reporter: | L U | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.1.47 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[9 Jul 2010 22:53]
L U
[10 Jul 2010 6:06]
Valeriy Kravchuk
This is not a bug. Please, read the manual, http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html: "In all lock modes (0, 1, and 2), if a transaction that generated auto-increment values rolls back, those auto-increment values are “lost.” Once a value is generated for an auto-increment column, it cannot be rolled back, whether or not the “INSERT-like” statement is completed, and whether or not the containing transaction is rolled back. Such lost values are not reused. Thus, there may be gaps in the values stored in an AUTO_INCREMENT column of a table."