Bug #56885 "Alter routine" double linespacing
Submitted: 21 Sep 2010 2:19 Modified: 13 Nov 2010 0:27
Reporter: Greg Thomas Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.29 CE OS:Windows
Assigned to: CPU Architecture:Any

[21 Sep 2010 2:19] Greg Thomas
Description:
If you edit a routine that was created with Windows line endings using the Workbench SQL Editor on Windows, that routine is double spaced - i.e. there is a blank line between each of the original lines.

The SQL Editor should cope with Windows and UNIX on all platforms. 

Note that if you edit a routine with UNIX line endings, the SQL Editor works fine.

How to repeat:
In MySQL Query Browser running on MS Windows, create a simple routine (note; could be done with any editor that creates routines with Windows line endings).

Edit that routine in Workbench SQL Editor.

Note that it is double spaced.

Suggested fix:
Modify the SQL Editor so that both Windows and UNIX line endings are recognised.
[21 Sep 2010 11:10] MySQL Verification Team
Thank you for the bug report. I created a file with extension .sql using Notepad and then openedn on WorkBench and edited and couldn't repeat the behavior reported. Could you please provide a sql script and comment the editor used. Thanks in advance.
[22 Sep 2010 22:54] Greg Thomas
OK, I re-created it using the following steps with the attached new_routine.txt file;

1. Launch MySQL Query Browser.
2. Select File .. Open Script. Open new_routine.txt. Note that it is single spaced.
3. Execute the script. Note that new_routine is created. 

All that has done is create a routine using a fairly standard method (prior to the available of Workbench 5.2 anyway)

4. Launch Workbench, and open a connection to the appropriate database for SQL Development.
5. Right click on "new_routine" and select "Alter routine ...". Note that it is double spaced.

Client and server are both Windows, the MySQL Workbench is 5.2.28, MySQL Server is version 5.1.50.
[22 Sep 2010 22:54] Greg Thomas
Sample routine

Attachment: new_routine.txt (text/plain), 234 bytes.

[29 Sep 2010 1:43] MySQL Verification Team
Thank you for the feedback. I couldn't repeat, please provide a screen-shot of the of the alter routine screen. Thanks in advance.
[29 Sep 2010 21:20] Greg Thomas
Screenshot of the new routine in the routine editor, as requested.

Attachment: Clipboard_01.png (image/png, text), 54.13 KiB.

[13 Oct 2010 17:10] MySQL Verification Team
Thank you for the feedback. Please try version 5.2.29. Thanks in advance.
[14 Oct 2010 20:18] Greg Thomas
Zipped version of the file

Attachment: new_routine.zip (application/zip, text), 289 bytes.

[14 Oct 2010 20:22] Greg Thomas
I can confirm that this still happens under 5.2.29. 

Also, I wondered if the uploading/download of the attachment was messing about with line endings, so I've added it again, only this time inside a ZIP file. You may be able to re-produce it using the steps I've already listed, using the file extracted from the ZIP.

I've just tried it again, using 5.2.29 and the ZIP file downloaded from bugs.mysql.com, and it's still exhibiting the same behaviour.
[17 Oct 2010 14:02] Valeriy Kravchuk
Still can not repeat with local server version 5.1.51 on Windows XP. What OS your server is running on?
[19 Oct 2010 16:16] Greg Thomas
Client is Win7 64bit
Server is Win2008 64bit, running MySQL 5.1.50
[13 Nov 2010 0:27] Alfredo Kojima
This looks like a duplicate of bug #55006
Greg, can you see if reverse engineering a new model containing the routine you created will exhibit the same problem when viewing the routine from the model's routine editor? Please reply in that bug, thanks!