Hello,
there is a bug with HeidiSQL 8.3.0.4822. If you recall a trigger which contains strings, the ' character isn't quoted. So the systax check is wrong and if you save this trigger you produce an error. All string values in trigger (and possible stored functions and procedures) must be quoted! This is missing.
Greetings Martin
[Bug] Edit a trigger with quoted strings
Cannot reproduce here. When creating a trigger, HeidiSQL executes this query:
When I then load the trigger again, it displays exactly this:
After modifying the code, HeidiSQL fires this one:
CREATE TRIGGER `tritest` BEFORE INSERT ON `foo` FOR EACH ROW BEGIN
insert into part (`Month`) values ('3');
END;
When I then load the trigger again, it displays exactly this:
BEGIN
insert into part (`Month`) values ('3');
END
After modifying the code, HeidiSQL fires this one:
DROP TRIGGER `tritest`;
CREATE DEFINER=`root`@`127.0.0.1` TRIGGER `tritest` BEFORE INSERT ON `foo` FOR EACH ROW BEGIN
insert into part (`Month`) values ('4');
END;
Code modification/commit
from ansgar.becker,
9 years ago,
revision 8.3.0.4825
Get trigger code from SHOW CREATE TRIGGER instead of using SHOW TRIGGERS, to fix a single quote escaping bug. See http://www.heidisql.com/forum.php?t=16501
Now I know why I had preferred SHOW TRIGGERS over SHOW CREATE TRIGGER: See here.
Please login to leave a reply, or register at first.