Bug #65619 Query Beautifier doesn't parse UNION clause correctly
Submitted: 14 Jun 2012 15:10 Modified: 14 Jun 2012 15:24
Reporter: Michael Rosenzweig Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.37 CE OS:Windows
Assigned to: CPU Architecture:Any

[14 Jun 2012 15:10] Michael Rosenzweig
Description:
Query beautifier gives the following results for the query with UNION clause:

Before:
select * from `table1` union select * from `table2`;

After:
select 
    *
from
    table1union select 
    *
from
    table2;

This looks ugly and certainly doesn't compile.

How to repeat:
1. Write any query which contains a UNION clause
e.g. select * from `table1` union select * from `table2`;

2. Goto Edit -> Format -> Beautify Query

Suggested fix:
At least, this needs a space before UNION keyword. Also, it would be nice to put UNION and/or SELECT to a new line.
[14 Jun 2012 15:24] Valeriy Kravchuk
This is a duplicate of Bug #64120. Should be fixed already. Please, upgrade.