blob: ef5f910e1a28eec51bfc680d7a60ac5faa7d50b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
CREATE TABLE t2 (i INT) ENGINE=InnoDB;
CREATE OR REPLACE TRIGGER tr1
AFTER UPDATE ON t2
FOR EACH ROW
INSERT INTO tlog (i) VALUES (1);
INSERT IGNORE INTO t2 VALUES (1);
CREATE TRIGGER IF NOT EXISTS tr2
BEFORE INSERT ON t2
FOR EACH ROW
INSERT INTO tlog (i) VALUES (2);
START TRANSACTION;
INSERT INTO t1 VALUES (1);
UPDATE t2 SET i = 3;
ERROR 42S02: Table 'test.tlog' doesn't exist
INSERT INTO t1 VALUES (2);
INSERT INTO t2 VALUES (4);
ERROR 42S02: Table 'test.tlog' doesn't exist
UPDATE t1 SET i = 4 LIMIT 1;
COMMIT;
SELECT * FROM t1;
i
4
2
SELECT * FROM t2;
i
1
DROP TABLE t1,t2;
|