あなたは使用しようとするかもしれませんEXIT HANDLER
:
DROP EVENT IF EXISTS `myDB`.`myEvent`;
CREATE EVENT IF NOT EXISTS `myDB`.`myEvent`
ON SCHEDULE
EVERY 15 MINUTE
COMMENT 'Some comment'
DO
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING
BEGIN
-- 1. Flag something, that should be tested in chained events
-- if they should be skipped. I.e.:
-- INSERT INTO `myDB`.`EventTable` (`event`, `failed`, `when`)
-- VALUES ('myEvent', TRUE, NOW());
-- OR
-- UPDATE
-- `myDB`.`EventTable`
-- SET
-- `failed` = TRUE,
-- `when` = NOW()
-- WHERE
-- `event` = 'myEvent';
-- 2. Quit.
END;
-- Do something, that may produce SQLEXCEPTION or SQLWARNING...
END;