Bug #1779 Inconsistent behaviour when using SELECT @var := ...
Submitted: 7 Nov 2003 11:22 Modified: 19 Nov 2003 7:07
Reporter: Henrik Schröder Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQLCC Severity:S2 (Serious)
Version:0.9.1-beta OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[7 Nov 2003 11:22] Henrik Schröder
Description:
MySQL returns different results depending on if you run a batch of statements or run them one by one, and if the statements contain a user variable assignment using SELECT @var :=...

This is pretty bad if you want to "single-step" through a batch of queries for debugging purposes since you get bad results. If you assign a user variable using SET you get no inconsistencies.

How to repeat:
Put this code in a MySQLCC SQL window:

SELECT @foo := 4711;
SELECT @foo;

If you execute all of it at once, it returns the results of the last query, which is 4711. (It also returns it as a String, but I think that's the specified behaviour even though it would be better if it was returned as an integer)

If you execute the statements one by one by selecting the first row, hitting ctrl-e, selecting the second row and then ctrl-e again, it returns 825308980. (As a number, not a string...)
[19 Nov 2003 7:07] MySQL Verification Team
I tested it with MySQLCC 0.9.3-beta and I wasn't able to repeat.
Please upgrade your MySQLCC to 0.9.3.