Bug #31659 Line breaks always converted to CR/LF on triggers and procedures
Submitted: 17 Oct 2007 8:09 Modified: 9 Jun 2009 12:55
Reporter: Frank Hieronymi Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.12 OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any
Tags: CR/LF, lf, Line Break, restore

[17 Oct 2007 8:09] Frank Hieronymi
Description:
When restoring a SQL file which has been generated using mysqldump, Query Browser sends CR/LF as line breaks independent of the format of the SQL dump (LF or CR/LF). The setting "Create Windows style line breaks (CR/LF)" is switched off.

Even though everything is working as expected after the import, it gives some headaches when it comes to comparing two databases with different line breaks used.

Restore via mysql command line doesn't work perfectly either and strips comments in triggers, procedures and functions. This is why it was recommended to use Query Browser.

How to repeat:
Create SQL dump with mysqldump (server version 5.0.37 in Windows XP or CentOS). Database uses INNODB engine with utf8 encoding, foreign keys, triggers, procedures and functions. Generated file could either use CR/LF as line breaks when generated on Windows without additional settings, or just LF when using the "--result-file=" option.

Create a new database using INNODB engine and utf8 encoding.

Load the SQL script into Query Browser, make sure "Create Windows style line breaks (CR/LF)" is switched off, select the new database and execute the script.

Watch e.g. for the triggers in temporary table TRIGGERS in information_schema and you will see that always CR/LF was imported.
[23 Oct 2007 0:04] MySQL Verification Team
Thank you for the bug report.
[9 Jun 2009 12:55] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Query Browser into MySQL Workbench. We won't fix this anymore.

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/