Bug #55463 | incorrect value returned by last_insert_id() function | ||
---|---|---|---|
Submitted: | 22 Jul 2010 0:25 | Modified: | 22 Jul 2010 4:38 |
Reporter: | Liliya Strupinskaya | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S5 (Performance) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[22 Jul 2010 0:25]
Liliya Strupinskaya
[22 Jul 2010 4:38]
Valeriy Kravchuk
This is clearly documented in the manual, http://dev.mysql.com/doc/refman/5.1/en/information-functions.html#function_last-insert-id: "Important If you insert multiple rows using a single INSERT statement, LAST_INSERT_ID() returns the value generated for the first inserted row only. The reason for this is to make it possible to reproduce easily the same INSERT statement against some other server."
[7 Sep 2016 20:04]
Don Cohen
This clear documentation really ought to be mentioned in other places where people (like me) are likely to look, such as http://dev.mysql.com/doc/refman/5.7/en/getting-unique-id.html which seems to very clearly state the exact opposite.