Bug #13635 Setting variables does not work as expected
Submitted: 30 Sep 2005 7:33 Modified: 30 Sep 2005 12:05
Reporter: John Beasley Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.15 (and .14) OS:Microsoft Windows (XP Pro SP2)
Assigned to: Mike Lischke CPU Architecture:Any

[30 Sep 2005 7:33] John Beasley
Description:
Using the Query Editor I execute:

SELECT @var := 'Something'; 

The Resultset gives a column heading of: @var := 'SOMETHING' and a value of: SOMETHING as expected.

However, when I now try SELECT @var; I get a column heading of @var and a value of NULL (not SOMETHING as I would expect).

Using the above at the command line within MySQL works OK.

The same effect seems occurs when running scripts from within MySQL Query Browser.

Is this intended behaviour or is it a problem?

Thanks

John

How to repeat:
See problem description...
[30 Sep 2005 12:05] Mike Lischke
This is not a bug. QB uses dynamich connections when executing a query (in opposition to the MySQL shell). So once the query is finished all things that are connection specific are gone, including variables. In order to avoid that start a transaction. In this situation the connection stays constant until the transaction is committed.

Mike