Bug #56083 Last character is dropped when loading SQL script
Submitted: 18 Aug 2010 10:05 Modified: 20 Sep 2010 13:29
Reporter: Herbert Schneider Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.26 OS:Windows (version 7)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: dropped, script, SQL, truncated

[18 Aug 2010 10:05] Herbert Schneider
Description:
I wrote with the workbench SQL editor a script which contains special german character (see file ScriptSave1.png of the attachment) in a comment line. There was no empty line at the end of the script. This script has been saved to disk.

When I now open the previous saved SQL script the last character is not displayed in the SQL editor window (the saved file contains it). This is shown in file ScriptSave2.png.

I don't know whether the bug exists only when using "รถ" or when using other special characters.

The system information is:
MySQL Workbench CE for Windows version 5.2.26
Data Directory: C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE
Cairo Version: 1.8.8
Rendering Mode: OpenGL is available on this system, so OpenGL is used for rendering.
OpenGL Driver Version: 3.2.0
OS: Microsoft Windows 7  (build 7600), 64-bit
CPU: 4x Intel(R) Core(TM)2 Quad CPU    Q9650  @ 3.00GHz, 7.9 GiB RAM
Video adapter info:
Adapter type: 
Chip Type: Quadro NVS 295
BIOS String: Version 62.98.6e.0.a
Video Memory: 262144 KB

How to repeat:
Set up a comment line with special character, save the script and load it again. 

Suggested fix:
Do not use special characters within comment lines. The problem is not seen when using version 5.2.21.
[18 Aug 2010 10:06] Herbert Schneider
Original script

Attachment: ScriptSave1.png (image/png, text), 3.05 KiB.

[18 Aug 2010 10:07] Herbert Schneider
Loaded script with last character dropped

Attachment: ScriptSave2.png (image/png, text), 4.27 KiB.

[18 Aug 2010 13:36] yoshiyuki yanagihara
This happens the same when I use Japanese characters.

It seems the problem happens when utf-8 code is used in SQL Editor, and in DDL text editor for Create Routine/Create View functions.

Additionaly, when I open the actual saved file with notepad, the file looks correctly saved.

Environment: Windows XP Pro SP3 (English)
[18 Aug 2010 17:01] MySQL Verification Team
Thank you for the bug report.
[7 Sep 2010 4:37] Alfredo Kojima
Appears to be Windows specific. 
Also, bug #56106 seems to be a duplicate
[9 Sep 2010 10:00] Mike Lischke
Fixed in repository.
[14 Sep 2010 18:17] Alfredo Kojima
Bug #56748 is a duplicate, although the effect is a little different
[16 Sep 2010 23:41] Johannes Taxacher
fix confirmed in respository
[20 Sep 2010 13:29] Tony Bedford
An entry has been added to the 5.2.28 changelog:

If a SQL script containing international characters was saved in the SQL Editor, and then restored, the last character in the restored file was missing.