Bug #58835 Query Formatter fails on sub-selects
Submitted: 9 Dec 2010 9:50 Modified: 3 May 2011 10:51
Reporter: Johannes Taxacher Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.31 OS:Any
Assigned to: CPU Architecture:Any

[9 Dec 2010 9:50] Johannes Taxacher
Description:
Query formatter doesn't process selects containing subqueries

How to repeat:
try to "beautify" this query:

SELECT * FROM sample_table where someCol IN (SELECT some_val FROM another_table)

this is printed to output:

File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sqlide_grt.py", line 170, in enbeautificate
    fmted = p.run()
File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sql_reformatter.py", line 745, in run
    while line[p] == ' ':
IndexError: string index out of range
[3 May 2011 10:51] Johannes Taxacher
fix confirmed in release
[7 May 2011 16:14] Paul DuBois
Noted in 5.2.34 changelog.

The query formatter failed for queries containing subqueries.
[7 May 2011 16:17] Paul DuBois
Correction: 5.2.33 changelog