Bug #46894 Text editor for VIEWs is too aggressive in trimming excessive whitespace
Submitted: 24 Aug 2009 14:02 Modified: 18 Nov 2009 17:53
Reporter: Craig Fowler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.1.17, 5.2.2a OS:Linux (Kubuntu Jaunty using (new Ubuntu 9.04) .deb installer)
Assigned to: CPU Architecture:Any
Tags: text-editor, UI

[24 Aug 2009 14:02] Craig Fowler
Description:
The text editor for editing VIEWs is very aggressive in trimming excess whitespace from VIEW definitions, this can cause unexpected errors if the user pauses typing for a moment.

How to repeat:
Create a new WB project with a new model.  Add a new view to that model.

In the text editor component begin typing on a new line (after the CREATE VIEW AS line):

"SELECT 'foo' AS " (note the trailing space)

Pause in typing for a second or two.  The trailing space is removed by the text editor component, meaning that if you begin typing an alias name for the field you will get a result like this:

"SELECT 'foo' ASfoo"

Suggested fix:
Either:

* Remove this feature entirely (excess whitespace will rarely create a syntax error anyway)

* Do not trim whitespace (or ideally, perform any formatting/correction of the text) mid-editing, only trim whitespace when saving a file (for example).

If the functionality to trim whitespace remains then could I request it be optional (configured via an options dialog)?  I imagine that I am not alone in having a preferred structure for my VIEWs.  I use whitespace to lay out and align things such as aliases and the like so that it is easy to read the view at a glance.  If the whitespace is removed/cropped then this structure is broken.
[24 Aug 2009 14:21] MySQL Verification Team
Not repeatable on Windows version.
[24 Aug 2009 14:37] MySQL Verification Team
I couldn't repeat on Ubuntu 9.04 64 bits using Gnome.
[24 Aug 2009 17:49] Valeriy Kravchuk
Not repeatable on Mac OS X.
[25 Aug 2009 12:57] Valeriy Kravchuk
Verified just as described on 32-bit Ubuntu 8.04, also with WB 5.2.2a. Platform-specific bug.
[18 Nov 2009 15:29] Johannes Taxacher
this has been fixed and will be included in 5.2.8
[18 Nov 2009 17:53] Tony Bedford
An entry was added to the 5.2.8 changelog:

The View text editor was overly aggressive in trimming excess whitespace from View definitions. If there was some hesitation in typing after having typed one or more spaces, the editor would trim whitespace back to the last non-space character typed.