我试图创建一个触发器更新整个表,其中Name ='test_user'。 这是我走到这一步:更新触发MySQL不工作
CREATE TRIGGER users.insert_log
AFTER INSERT ON users.logBook
FOR EACH ROW
UPDATE users.logBook
SET UserName = 'SQL_TEST'
WHERE
UserName = 'test_user';
它创建了扳机,没有任何问题。 但插入我得到这个错误时:
ERROR 1442 (HY000): Can't update table 'logBook' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
如何更新我行其中username = test_user?