Bug #39119 Missing DROP TRIGGER commands on export
Submitted: 29 Aug 2008 13:37 Modified: 13 Oct 2008 14:41
Reporter: Bogdan Bezuz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.24 OS:Windows (XP SP3)
Assigned to: Mike Lischke CPU Architecture:Any

[29 Aug 2008 13:37] Bogdan Bezuz
Description:
Situation: export table with triggers
Case
- export table + triggers with "generate DROP TABLES statements" checked -> DROP TRIGGER IF EXISTS appears in the sql export

- export table + triggers with "generate DROP TABLES statements" unchecked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export

- export triggers with "generate DROP TABLES statements" checked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export

- export triggers with "generate DROP TABLES statements" unchecked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export

How to repeat:
- export table + triggers with "generate DROP TABLES statements" checked -> DROP TRIGGER IF EXISTS appears in the sql export

- export table + triggers with "generate DROP TABLES statements" unchecked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export

- export triggers with "generate DROP TABLES statements" checked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export

- export triggers with "generate DROP TABLES statements" unchecked -> DROP TRIGGER IF EXISTS does NOT appear in the sql export
[29 Aug 2008 16:27] Valeriy Kravchuk
Thank you for a problem report. Verified just as described.

In my test incorrect trigger name was used even when DROP TRIGGER statement was generated:

DROP TRIGGER IF EXISTS `mydb`.`SYNTAX_ERROR_1` //
create trigger trg before insert into table1 for each row set @a:=1;//
[8 Sep 2008 12:23] Mike Lischke
Fixed in revs 3195 and 3196

The option for generation of the DROP statements has been changed too to indicate it is not only for tables.
[8 Sep 2008 18:38] Johannes Taxacher
Fixed as described by developer. fix will go into 5.0.25
[13 Oct 2008 14:41] Tony Bedford
An entry was added to the 5.0.25 changelog:

When triggers were exported with the Generate DROP TABLES statements option checked, DROP TRIGGER IF EXISTS did not appear in the exported SQL.