Bug #19758 'Access violation' error if there are more than 1 trigger for the table
Submitted: 12 May 2006 8:58
Reporter: Victoria Reznichenko Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Workbench Preview Severity:S3 (Non-critical)
Version:1.0.6 OS:Microsoft Windows (windows)
Assigned to: CPU Architecture:Any

[12 May 2006 8:58] Victoria Reznichenko
Description:
If you create 2 triggers for the same table then if you try to add 3rd trigger MySQL Workbench reports 'Access violation' in the status bar.

How to repeat:
1. create table with trigger. I did it via command-line tool using example from manual and then did reverse engineering.

CREATE TABLE test1(a1 INT);
CREATE TABLE test2(a2 INT);
CREATE TABLE test3(a3 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE test4(
  a4 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
  b4 INT DEFAULT 0
);

DELIMITER |

CREATE TRIGGER testref BEFORE INSERT ON test1
  FOR EACH ROW BEGIN
    INSERT INTO test2 SET a2 = NEW.a1;
    DELETE FROM test3 WHERE a3 = NEW.a1;  
    UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
  END;
|

DELIMITER ;

2. Now open edit window to edit table test1.
3. Go to Triggers tab, copy trigger body, paste it into 'New_Trigger', change trigger name, press 'Apply changes'
4. Close edit window
5. Open edit window again, go to Triggers tab, try to type anything in 'New_Trigger' part.
6. Look at the status bar.
[23 Jul 2006 8:26] Shane Bester
Access violation at address 00473750 in module 'MySQLWorkBench.exe'. Read of address 00000008