我收到 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 ;
这是我尝试导入的旧数据库文件的转储。
谢谢!