Bug #80132 LEFT and RIGHT functions: syntax error if len is an expression
Submitted: 24 Jan 2016 22:48 Modified: 25 Jan 2016 8:22
Reporter: George Marshall Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.2.3.12312 OS:Windows (win 7)
Assigned to: CPU Architecture:Any
Tags: expression, LEFT RIGHT syntax, variable

[24 Jan 2016 22:48] George Marshall
Description:
Workbench erroneously indicates syntax error for LEFT or RIGHT functions if len is a variable or expression.  The statement will run correctly and produce correct output, but the on-screen syntax error indication is misleading.

Other string functions requiring a len appear to accept expressions.

In the example below, the len field will have an 'error' underline.

How to repeat:
set @n = 4;
select LEFT('abcdef',@n);  # shows error, but runs correctly.

# second example:
select LEFT('abcdef',2+2);  # shows error, but runs correctly.

Suggested fix:
Allow LEFT() and RIGHT() to accept expressions for the len.
[25 Jan 2016 4:44] MySQL Verification Team
Hello George,

Thank you for your bug report. 
This issue issue is no longer seen,  already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/

Please try and let us know if you are still seeing the issue in WB 6.3.6.

Thanks,
Umesh
[25 Jan 2016 4:45] MySQL Verification Team
Screenshot..

Attachment: 80132.png (image/png, text), 41.41 KiB.

[25 Jan 2016 7:42] George Marshall
I tried 6.3.6, per your suggestion, but I am unable to verify that the bug is fixed.
The reason is that 6.3.6 can only execute one query.  After that, it reports erro 2006, MYSQL server has gone away.  The error is consistent, whether I simply recoonect, or first reboot my PC.
Please advise.
[25 Jan 2016 7:54] George Marshall
Further info:
I uninstalled 6.3.6, and installed 6.2.5.

6.2.5 is working for me - the syntax error I reported is gone, and WB does not lose its connection as 6.3.6.

I consider my syntax bug resolved.
Would you like me to submit a bug report on the connection loss problem I saw in 6.3.6?
[25 Jan 2016 8:22] MySQL Verification Team
Thank you for confirming.
Please report new bug for the connection loss issue along with exact repeatable steps, screenshot and complete wb long. Please enable the debug3 level before generating a log for the report - see, https://dev.mysql.com/doc/workbench/en/workbench-reporting-bugs.html

Thanks,
Umesh