Bug #14173 suboptimal documentation of LAST_INSERT_ID() function
Submitted: 20 Oct 2005 11:36 Modified: 21 Oct 2005 11:22
Reporter: Jigal van Hemert Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:online docs OS:online docs
Assigned to: Jon Stephens CPU Architecture:Any
Triage: D4 (Minor)

[20 Oct 2005 11:36] Jigal van Hemert
Description:
Documentation currently says:
" Returns the last automatically generated value that was inserted into an AUTO_INCREMENT column."
Later on it is explained that for mulit-row inserts it is the first generated value.

How to repeat:
none (documentation issue)

Suggested fix:
To prevent confusion the first line of the description should perhaps read:
" Returns the first automatically generated value that was inserted (or updated) into an AUTO_INCREMENT column during the last query."
If a single row insert is used it is both the first and the last value, if a multi row insert is used it is the first value of that insert.
[20 Oct 2005 11:44] Valeriy Kravchuk
Thank you for a documentation request. 

You mean the description of LAST_INSERT_ID() at http://dev.mysql.com/doc/refman/4.1/en/information-functions.html, I suppose? I agree that more precise first sentence is needed, for those who don't like to read it all.
[21 Oct 2005 11:22] Jon Stephens
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
product(s).

Additional info:

Reworked description of LAST_INSERT_ID() and added an example.

Thanks for the suggestion.