Gabor Hojtsy wrote:
> Read the docs of the function, it is not the same. The function is
> supposed to return the ID *you have inserted* in this session, while the
> SELECT return the ID last *inserted by someone*, maybe paralelly to your
> session.

MySQL LAST_INSERT_ID() documentation says: "The last ID that was
generated is maintained in the server on a per-connection basis. This
means the value the function returns to a given client is the most
recent AUTO_INCREMENT value generated by that client. The value cannot
be affected by other clients, even if they generate AUTO_INCREMENT
values of their own."

Thus it should be the same. Anyway, I am against making this function
obsolete.

Jakub Vrana

Reply via email to