尝试在“ build”中输入值时出现错误,这会触发(兼容性=“ no”)以下触发器
CREATE TRIGGER `deletebuild` AFTER INSERT ON `compatibility` FOR EACH ROW IF 'no'= (select compatibility from compatibility where id = (select max(id) from compatibility))
THEN
DELETE FROM `build` order by id desc limit 1;
END IF
我还有另一个触发器
CREATE DEFINER=`root`@`localhost` TRIGGER `compatible` AFTER INSERT ON `build` FOR EACH ROW IF (SELECT 1 FROM build b,processor_products pp, motherboard m WHERE b.Processor=pp.Name AND b.Motherboard=m.name AND pp.Socket<>m.Socket AND Id = (SELECT max(id) FROM build))
THEN
INSERT INTO compatibility(compatibility) VALUE('no');
ELSE
INSERT INTO compatibility(compatibility) VALUE('yes');
END IF
如果删除触发器compatibility
,我可以输入值
我该如何纠正?