Bug #5860 Multi-table UPDATE does not activate update triggers
Submitted: 2 Oct 2004 16:11 Modified: 1 Jun 2005 3:34
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.2 (1.1629) OS:
Assigned to: Dmitry Lenev CPU Architecture:Any

[2 Oct 2004 16:11] Dean Ellis
Description:
Multi-table UPDATE does not activate UPDATE triggers.

How to repeat:
USE test;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 ( a int );
CREATE TABLE t2 LIKE t1;
CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW SET new.a=old.a;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
UPDATE t1 SET a=101;
SELECT a FROM t1;
UPDATE t1 INNER JOIN t2 USING (a) SET t1.a = t2.a+100;
SELECT a FROM t1;
DROP TABLE t1, t2;

Suggested fix:
n/a
[25 May 2005 4:07] Dmitry Lenev
Fixed in 5.0.7
[25 May 2005 4:08] Dmitry Lenev
This patch also fixed similar problem for multi-delete.
[1 Jun 2005 3:34] Paul DuBois
Noted in 5.0.7 changelog.
[29 Jun 2005 6:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26506