Bug #69090 Trigger bodies containing the "\" character are returned unescaped
Submitted: 29 Apr 2013 4:53 Modified: 29 Apr 2013 7:46
Reporter: Stian Brattland Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S2 (Serious)
Version:5.1.69-0ubuntu0.10.04.1 OS:Linux (Ubuntu 10.04)
Assigned to: CPU Architecture:Any
Tags: DDL

[29 Apr 2013 4:53] Stian Brattland
Description:
I've been having trouble using MySQL Workbench to alter tables which have triggers on them. Every time I would attempt to alter a table, I would only get the error message "Error parsing DDL for [database].[table] : there was an error while parsing the DDL retrieved from the server. Do you want to view the DDL or cancel processing it?"

I initially reported this as a MySQL Workbench bug in May 2011, but the bug was closed unresolved in December 2012 with the explanation that this was a server bug : "The problem is caused by a server bug. Trigger bodies that contain strings with the \ character are returned unescaped by the information_schema or show triggers." (see http://bugs.mysql.com/bug.php?id=61110&thanks=2&notify=195).

So, I'm reporting this as a MySQL bug.

How to repeat:
1. Install MySQL workbench (latest version)
2. Install Ubuntu 10.04 with MySQL (the one available from repositories, which is 5.1.69-0ubuntu0.10.04.1 in my case)
3. Create a database and a table. 
4. Install a trigger on the table.
5. Open MySQL workbench, connect to the database and locate the table.
6. Right click on the table and select "Alter Table...".
7. Error message will be shown.

Suggested fix:
Can't really say anything about this. I can only say that something seems to be wrong somewhere.
[29 Apr 2013 7:46] MySQL Verification Team
Hello Stian,

Thank you for the report.
Verified as described on 5.6.11( WB 5.2.47)

Thanks,
Umesh
[29 Apr 2013 7:51] MySQL Verification Team
How to repeat:

This can be easily repeatable on OEL6, MySQL 5.6.11

1. Install MySQL workbench (latest version 5.2.47)
2. Create a database and a table. 

CREATE TABLE account (acct_num INT, amount DECIMAL(10,2), audit varchar(50));

3. trigger on the table.

delimiter //
 CREATE TRIGGER upd_check BEFORE UPDATE ON account
    FOR EACH ROW
    BEGIN
        IF NEW.amount < 0 THEN
            SET NEW.amount = 0, NEW.AUDIT = "\\";
        ELSEIF NEW.amount > 100 THEN
            SET NEW.amount = 100, NEW.AUDIT = "\\";
        END IF;
    END;//
 delimiter ;

4. Open MySQL workbench, connect to the database and locate the table.
5. Right click on the table and select "Alter Table...".
6. Error message will pop up