Bug #58366 Error calling SQLIDEUtils.embeautificate
Submitted: 21 Nov 2010 23:55 Modified: 22 Nov 2010 0:14
Reporter: arnaud lemercier Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.30 OS:Windows (7)
Assigned to: CPU Architecture:Any

[21 Nov 2010 23:55] arnaud lemercier
Description:
Hello,

When I select a query (Highlighted) and I do "Edit > Format > Beautify Query"
I have a fatal error.

How to repeat:
1 - Write a simple query
    Ex : SELECT * FROM Users;
2 - Select the query text
3 - "Edit > Format > Beautify Query"

Suggested fix:
;)
[21 Nov 2010 23:57] arnaud lemercier
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sqlide_grt.py", line 162, in enbeautificate
    editor.replaceSelection()

TypeError: db.query.QueryBuffer.replaceSelection() takes 1 arguments (0 given)
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sqlide_grt.py", line 162, in enbeautificate
    editor.replaceSelection()

TypeError: db.query.QueryBuffer.replaceSelection() takes 1 arguments (0 given)
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sqlide_grt.py", line 162, in enbeautificate
    editor.replaceSelection()

TypeError: db.query.QueryBuffer.replaceSelection() takes 1 arguments (0 given)
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\modules\sqlide_grt.py", line 162, in enbeautificate
    editor.replaceSelection()

TypeError: db.query.QueryBuffer.replaceSelection() takes 1 arguments (0 given)
[22 Nov 2010 0:14] Alfredo Kojima
Duplicate of bug #58358

You can workaround by not selecting any text when calling the command.