MySQL错误1235

时间:2016-05-24 21:13:21

标签: php mysql mysql-error-1235

我收到MySQL错误1235,并且已经尝试了我可以在SO上找到的所有解决方案。

 --
 -- Trigger `buying_tasks`
 -- DELIMITER $$ CREATE TRIGGER `lock_user_of_task_buying_task` BEFORE INSERT ON  `buying_tasks`  FOR EACH ROW UPDATE  `users` SET locked =1
 WHERE id = NEW.user_id$$

有错误

   #1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'

以下是完整的操作:

DELIMITER $$
CREATE TRIGGER `lock_user_of_task_buying_task` BEFORE INSERT ON `buying_tasks`
 FOR EACH ROW UPDATE `users` SET locked = 1 WHERE id = NEW.user_id
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `unlock_user_of_task_buying_task` AFTER DELETE ON `buying_tasks`
 FOR EACH ROW UPDATE `users` SET locked = 0 WHERE id = OLD.user_id
$$
DELIMITER ;

这是我尝试导入的旧数据库文件的转储。

谢谢!

0 个答案:

没有答案