Bug #73661 Beautifier breaks SQL execution
Submitted: 20 Aug 2014 22:51 Modified: 25 Aug 2014 19:24
Reporter: Aram Mirzadeh Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.1.7 OS:Microsoft Windows (8.1)
Assigned to: CPU Architecture:Any

[20 Aug 2014 22:51] Aram Mirzadeh
Description:
Using the beautifier button adds spaces after NOW() function calls which creates a syntax error during execution.

How to repeat:

SELECT NOW() FROM DUAL;

after beautify:

SELECT NOW () FROM DUAL;

Error when executed:

Action: SELECT NOW () FROM DUAL LIMIT 0, 100
Error Code: 1630. FUNCTION TLMA25.NOW does not exist. Check the
'Function Name Parsing and Resolution' section in the Reference
Manual  0.078 sec

However: 

SELECT YEAR(2004) FROM DUAL; 

does not change post beautification: 

SELECT YEAR(2004) FROM DUAL;
[20 Aug 2014 22:52] Aram Mirzadeh
See bug#58714
[21 Aug 2014 0:32] Miguel Solorzano
Thank you for the bug report.
[25 Aug 2014 19:24] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.2.2 release, and here's the changelog entry:

The SQL beautification feature would change "NOW()" to "NOW ()" (note
the inserted space), which created an SQL syntax error.

Thank you for the bug report.
[5 Sep 2014 16:50] Miguel Solorzano
http://bugs.mysql.com/bug.php?id=73818 marked as duplicate of this one.
[12 Sep 2014 22:18] Shane Bester
https://bugs.mysql.com/bug.php?id=73908 is a duplicate