>>>>> "Oliver" == Oliver Artelt <oli@stripped> writes:
Oliver> On Sun, 14 Mar 1999, Tauren Mills wrote:
>>
>>
>> After reading the manual, I have a question about Auto-Increment...
>>
>> The manual says that I can use this query to find out the value of the most
>> recent AUTO_INCREMENT field:
>>
>> SELECT * FROM tbl_name WHERE auto_col IS NULL
>>
Oliver> Lock the table before your INSERT and SELECT statement. Another way is to
Oliver> stamp the rows yourself, e.g. functions related to RPC.
Oliver> oli.
Hi!
No, there is no need to lock the rows in the above case.
The above query is automaticly transformed to:
SELECT * FROM tbl_name WHERE auto_col = LAST_INSERT_ID()
and the LAST_INSERT_ID() variable is thread safe (will not be affected
by other clients)
Regards,
Monty