ERROR 1442 (HY000): Can't update table '120_xx_220416' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
如果出现这个问题,则是循环的调用造成的
触发器里面,不要出现insert/update
解决办法如下:
drop TRIGGER if EXISTS 120_xx;
delimiter //
CREATE TRIGGER 120_xx
before INSERT
ON 120_xx_220416
FOR EACH ROW
BEGIN
set NEW.ask_md5 = md5(CONCAT(NEW.title,NEW.answer));
END;
//
delimiter //
CREATE TRIGGER 120_xx_update
before update
ON 120_xx_220416
FOR EACH ROW
BEGIN
set NEW.ask_md5 = md5(CONCAT(NEW.title,NEW.answer));
END;
//
阅读(1257) | 评论(0) | 转发(0) |