create trigger mailbox_update after update on mailbox for each row update mailbox set password=NEW.password where uid=NEW.uid and password<>NEW.password;
1442 (HY000): Can't update table 'mailbox' in stored function/trigger because it is already used by statement which invoked this stored function/ trigger.
这是何故,是 mysql的触发器不能触发本表吗? 作者: kider 时间: 2007-11-13 14:32
你是怎样更新的?作者: sniper 时间: 2007-11-13 14:36
update mailbox set password='444' where username='yuan';
这种情况应该是尽量避免的。
A more helpful title for this bug might be "Cannot join against trigger table while
modifying another table in a trigger."
trigger limitations that one can not select from the table on which the trigger is firing from within that trigger.
应该是MySQL Trigger的limitations:
in function or trigger you should not modify table which is modified or JUST READ by statement (or by any statement from the chain of statements) that invoke this function or trigger.