Bug #58864 | Clarify LAST_INSERT_ID() behavior on update by INSERT ON DUPLICATE KEY UPDATE | ||
---|---|---|---|
Submitted: | 10 Dec 2010 12:13 | Modified: | 19 Jul 2011 15:09 |
Reporter: | Terry Nycum | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S4 (Feature request) |
Version: | 5.1 | OS: | Any |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | insert on duplicate, insert on duplicate key update, LAST_INSERT_ID |
[10 Dec 2010 12:13]
Terry Nycum
[19 Jul 2011 15:09]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. Revised wording: If a table contains an AUTO_INCREMENT column and INSERT ... ON DUPLICATE KEY UPDATE inserts or updates a row, the LAST_INSERT_ID() function returns the AUTO_INCREMENT value. Exception: For updates, LAST_INSERT_ID() is not meaningful prior to MySQL 5.1.12. However, you can work around this by ...