Triggers and Implicit Locks
Explains how triggers can cause implicit locks on referenced tables during the execution of a statement, potentially affecting concurrency.
Example
LOCK TABLE table1 WRITECREATE TRIGGER trigger1 AFTER INSERT ON table1 FOR EACH ROW
BEGIN
INSERT INTO table2 VALUES (1);
UPDATE table3 SET writes = writes+1
WHERE id = NEW.id AND EXISTS (SELECT id FROM table4);
END;Last updated
Was this helpful?

