Bug #66807 Wrong AUTO_INCREMENT value when using ON DUPLICATE KEY UPDATE clause
| Submitted: | 13 Sep 2012 12:34 | Modified: | 13 Sep 2012 17:09 |
|---|---|---|---|
| Reporter: | Matteo Tassinari | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
| Version: | 5.1.41 | OS: | Windows (Windows 7 32bit) |
| Assigned to: | CPU Architecture: | Any |
[13 Sep 2012 12:34]
Matteo Tassinari
[13 Sep 2012 12:52]
Peter Laursen
I think you should read this: http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_autoinc_lock_m... and http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html (and besides there is no rule in SQL databases that there cannot be 'gaps' in values assigned to an auto_increment column). Unless I overlook some detail this is the same as was reported here at least 10 times before - and in all cases rejected as 'not a bug'. But you can achieve the behavior you want by setting innodb_autoinc_lock_mode to "0" in configuration. As far as I know "1" is now default as it improves some replication scenarios. But if you don't use replication, it does not matter of course. Peter (not a MySQL/Oracle person)
[13 Sep 2012 17:09]
Sveta Smirnova
Thank you for the report. Peter is absolutely correct: this is not a bug. So I am closing it as such.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.