Bug #8082 LAST_INSERT_ID() does not work
Submitted: 21 Jan 2005 22:22 Modified: 31 Jan 2005 21:36
Reporter: Nick Fu Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.5 OS:Windows (Win XP)
Assigned to: CPU Architecture:Any

[21 Jan 2005 22:22] Nick Fu
Description:
I practiced coding based on http://dev.mysql.com/doc/mysql/en/example-Foreign_keys.html

SELECT @last := LAST_INSERT_ID(); in QueryBrowser always return 0.

Also, I cannot run more than one query at once in the browser.  For example, outting "select * from person; select * from shirt;" will not work.

How to repeat:
http://dev.mysql.com/doc/mysql/en/example-Foreign_keys.html,

Start from 
CREATE TABLE person (

End at
SELECT * FROM shirt;

Notice in shirt table all the owner will be 0.
[22 Jan 2005 2:05] MySQL Verification Team
Thank you for the bug report.
[23 Jan 2005 18:02] Thomas CORBIERE
This is not a bug.

See this (unrelated to LAST_INSERT_ID()) bug report for an explanation : http://bugs.mysql.com/bug.php?id=7460

I tried to use LAST_INSERT_ID() both with transaction and a script tab and it works.

And about the query toolbar, it execute a single query on purpose.
If you want multiple queries, then you'll have to use a script tab.
[31 Jan 2005 21:36] Michael G. Zinner
Thanks for pointing out the behaviour. What you state is absolute correct.