apostrophe in DELIMITER not escaped

zhanhb's profile image zhanhb posted 8 years ago in General Permalink

I create a trigger, and then I export it, but I can't get correct statement SQL.

2 attachment(s):
ansgar's profile image ansgar posted 8 years ago Permalink

Ok, you created a trigger using $$ as the delimiter, and HeidiSQL prefers // as delimiter. Where's now the problem, or is there any? Is there any error message you get with the exported SQL? Which HeidiSQL version is it?

TTSneko's profile image TTSneko posted 8 years ago Permalink

His CREATE.TXT ... with backslash following the ampersand:

REGEXP '^([a-z0-9!#$%&\'*+

The EXPORT.TXT ... with no backslash following the ampersand:

REGEXP '^([a-z0-9!#$%&'*+
ansgar's profile image ansgar posted 8 years ago Permalink

Yes, I see. The underlying problem is the result of this query:

SHOW TRIGGERS FROM `testdb` WHERE `Trigger`='user_email_check_update';

The 4th column ("Statement") lacks the backslash in front of the single quote. Why is that the case?

ansgar's profile image ansgar posted 8 years ago Permalink

See this other thread - old problem. Sigh...

Also I found my own comment in the trigger editor, introduced in r4842:

// "Statement" column from SHOW TRIGGERS does not escape single quotes where required. // See http://www.heidisql.com/forum.php?t=16501 // But SHOW CREATE TRIGGER was introduced in MySQL 5.1.21 // See http://www.heidisql.com/forum.php?t=16662

I will see how I can adapt the same logic to the export dialog.

Please login to leave a reply, or register at first.