Bug #66664 Values from functions not preserved in user defined variables
Submitted: 3 Sep 2012 10:25 Modified: 3 Oct 2012 15:11
Reporter: Pascual Strmsns Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.42 OS:MacOS (Darwin 12.1.0)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[3 Sep 2012 10:25] Pascual Strmsns
Description:
The following statement yields a blank result for "TEST" in MySQL Workbench:
SELECT NOW() INTO @a;SELECT @a as 'TEST';

However, in MySQL CLI the same query gives this, correct, result:

mysql> SELECT NOW() INTO @a;SELECT @a as 'TEST';
Query OK, 1 row affected (0.00 sec)

+---------------------+
| TEST                |
+---------------------+
| 2012-09-03 12:16:44 |
+---------------------+
1 row in set (0.03 sec)

----- Developer Notes -----

MySQL Workbench CE for Mac OS X version 5.2.42  revision 9752
Configuration Directory: /Users/pascual/Library/Application Support/MySQL/Workbench
Data Directory: /Applications/MySQLWorkbench.app/Contents/Resources
Cairo Version: 1.9.1
OS: Darwin 12.1.0
CPU: 2x Intel(R) Core(TM)2 Duo CPU     T9600  @ 2.80GHz, 4.0 GB RAM

How to repeat:
Type SELECT NOW() INTO @a;SELECT @a as 'TEST'; into MySQL Workbench and compare results to results 
from MySQL CLI.
[3 Sep 2012 11:21] MySQL Verification Team
Output on Windows

Attachment: output_of_test.png (image/png, text), 27.13 KiB.

[3 Sep 2012 11:22] MySQL Verification Team
Thank you for the bug report. I tested on Windows, please see attached picture if it's same result for you on MAC. Thanks.
[3 Sep 2012 11:29] Pascual Strmsns
Screenshot of output on Mac OS X

Attachment: 2012-09-03_1325.png (image/png, text), 22.72 KiB.

[3 Sep 2012 12:02] Leandro Morgado
Tested this in Mac OS X 10.6.8, WB 5.2.42 and MySQL 5.5.14-enterprise-commercial-advanced and received the expected results. Screenshot attached below.
[3 Sep 2012 12:04] Leandro Morgado
output on Mac OS X

Attachment: Screen shot 2012-09-03 at 12.59.46.png (image/png, text), 99.53 KiB.

[3 Sep 2012 12:18] Pascual Strmsns
I seems that this issue might be related to the MySQL server version.

The blank result was with 5.0.67-log, and I have now tested with 5.5.25a which indeed gives to desired result.

It then would seem that this is not a MySQL Workbench bug.
[3 Sep 2012 15:01] Alfredo Kojima
Are you using the correct execute all command instead of execute current statement?
[4 Oct 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".