Bug #64120 "Beautify Query" on a UNION sentence, leaves query with syntax errors.
Submitted: 24 Jan 2012 15:29 Modified: 3 Feb 2012 3:55
Reporter: Rodrigo Díaz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:v5.2.37 rev 8576 OS:Any (Ubuntu 11.10 x64, Mac OS X)
Assigned to: CPU Architecture:Any
Tags: beautify query union editor

[24 Jan 2012 15:29] Rodrigo Díaz
Description:
The "Beautify Query" feature incorrectly formatted a statement containing a UNION clause, leaving the query with syntax errors.

How to repeat:
- In the SQL Editor, write this query:

SELECT 1
UNION
SELECT 2;

- Use "Beautify Query".
- Run the resulting query (SELECT 1UNION SELECT 2;).

Suggested fix:
The UNION clause should go on its own line

SELECT 1
UNION 
SELECT 2;

, or at least separated by a space

SELECT 1 UNION SELECT 2;
[24 Jan 2012 17:23] Valeriy Kravchuk
Thank you for the bug report. Verified with 5.2.37 on Mac OS X also.
[3 Feb 2012 3:55] Philip Olson
Fixed as of 5.2.38:

The "Beautify Query" feature incorrectly
formatted statements containing the "UNION"
clause, which left the query with syntax errors.