Bug #46349 Trigger ddl disappear when I write it
Submitted: 23 Jul 2009 11:10 Modified: 7 Aug 2009 15:29
Reporter: Leandro Vidal Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1.16 OS:Windows (XP)
Assigned to: Sergei Tkachenko CPU Architecture:Any
Tags: trigger write disapeear

[23 Jul 2009 11:10] Leandro Vidal
Description:
Hi. When I write a trigger, if there are any mistake on it and I don't write anything about 3 seconds, the trigger text disappear and I have to start again.

How to repeat:
Try to write a trigger with mistakes.

Suggested fix:
Only highlights mistakes but never delete them.
[23 Jul 2009 11:19] Valeriy Kravchuk
What exact version of WB, 5.1.x, do you use? Please, send also the text of trigger with exact mistake that leads to the problem after 3 seconds of wait.
[23 Jul 2009 11:26] Leandro Vidal
My version is 5.1.16

I've written step by step the trigger and every thing disappear when I've wrote this:

CREATE TRIGGER xxx AFTER INSERT ON vehicle
FOR EACH ROW
BEGIN

END

Only found if I write it but not if a paste it.
[23 Jul 2009 11:26] Leandro Vidal
Version 5.1.16
[23 Jul 2009 12:12] Valeriy Kravchuk
I can not repeat this on Mac OS X. May be platform-specific.
[23 Jul 2009 12:13] Leandro Vidal
Neither in my mac.
[23 Jul 2009 14:00] Sergei Tkachenko
I don't see any syntax mistake in provided statement:

CREATE TRIGGER xxx AFTER INSERT ON vehicle
FOR EACH ROW
BEGIN

END

I suppose `vehicle` wasn't the table you was editing when added trigger, was it?
If so, look for newly created (or existing) `vehicle` table in physical schemata overview. In that table you will find your trigger.
[23 Jul 2009 14:12] Leandro Vidal
I think the problem is that between BEGIN and END there isn't any valid statement. If I write any sentence between that part, till I stop, WB deletes everything. When I stop typing, if it hasn't got any mistake, WB doesn't delete anything.
[23 Jul 2009 14:32] Sergei Tkachenko
Failed to reproduce with snapshot version, could be that it was already fixed.
[23 Jul 2009 15:30] Leandro Vidal
I've installed 5.2 Alpha version and I can't reproduce the error, so I think the bug is resolved in next future version.
[6 Aug 2009 18:19] Johannes Taxacher
specifying wrong table in triggerstatement doesn't cause trigger to be moved to the "wrong" table but is highlighted as syntax error. fix will be included in 5.1.17
[7 Aug 2009 15:29] Tony Bedford
A 'change' entry has been added to the 5.1.17 changelog:

Bug reported: If code with an error was entered into the Triggers tab of the Table Editor, the code disappeared when typing stopped.

What actually happened was when a table name was given that was not that of the table currently being edited, the trigger code was moved to the table specified.

MySQL Workbench has now been changed so that if a table name is specified other than other than that of the table being edited, then the table name is highlighted as a syntax error, rather than moving the trigger code to the table actually specified.