Bug #73804 prepared statements show as syntax error
Submitted: 4 Sep 2014 10:36 Modified: 6 Nov 2014 6:45
Reporter: austin woz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.2.2 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: prepared statements workbench, regression

[4 Sep 2014 10:36] austin woz
Description:
stored procedures show error for prepared statements on the execute line

How to repeat:
EXECUTE stmt; 
this line will show a syntax error on the semi colon.

EXECUTE stmt using @e;
this line will NOT show a syntax error.

EXECUTE stmt using "e";
this shows an error on "e".

Suggested fix:
it thinks 'using' is mandatory when it is optional.

also it requires the value after 'using' is preceded by '@', i dont know if this is a true systax error or not.
[4 Sep 2014 11:00] MySQL Verification Team
Hello Austin,

Thank you for the report.
Verified as described.

Thanks,
Umesh
[4 Sep 2014 11:04] MySQL Verification Team
If the prepared statement contains any parameter markers, you must supply a USING clause that lists user variables containing the values to be bound to the parameters. 
Parameter values can be supplied only by user variables. Without parameter markers, it should allow EXECUTE stmt1; but with 6.2.1 it shows as if syntax error even though it is executable.

How to repeat:

Try to execute below statement in 6.1.7 and 6.2.1.. Later one shows syntax error in the editor where as 6.1.7 shows nothing(which is expected).

PREPARE stmt1 FROM 'SELECT SQRT(POW(3,2) + POW(4,2)) AS hypotenuse';
EXECUTE stmt1;
[4 Sep 2014 11:09] MySQL Verification Team
Screenshot..

Attachment: 73804.png (image/png, text), 35.44 KiB.

[17 Sep 2014 14:27] Takahito Torimoto
Mac OSX 6.2.2.12242 Build 2167 Community Ed (RC)

Attachment: MySQL Workbench 2014-09-17 10-27-02.png (image/png, text), 13.65 KiB.

[6 Oct 2014 13:39] austin woz
I have found another issue with syntax error.
In the following statement it highlights the word INTEGER as a syntax error,when it is fine

SELECT CAST(343 AS UNSIGNED INTEGER)  ;
[6 Nov 2014 6:45] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.2.4 release, and here's the changelog entry:

The SQL syntax checker would show errors for EXECUTE statements without
the "using" keyword.

Thank you for the bug report.