diff --git a/src/Ifsnop/Mysqldump/Mysqldump.php b/src/Ifsnop/Mysqldump/Mysqldump.php index 106e1dc..68cf2ab 100644 --- a/src/Ifsnop/Mysqldump/Mysqldump.php +++ b/src/Ifsnop/Mysqldump/Mysqldump.php @@ -2077,7 +2077,7 @@ public function create_event($row) $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50117 \2*/ '; if ($eventStmtReplaced = preg_replace( - '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(EVENT .*)$/', + '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(EVENT\s.*)$/s', '/*!50106 \1*/ '.$definerStr.'/*!50106 \3 */', $eventStmt, 1 diff --git a/tests/test012.src.sql b/tests/test012.src.sql index 360a143..bd1223a 100644 --- a/tests/test012.src.sql +++ b/tests/test012.src.sql @@ -30,3 +30,11 @@ BEGIN SELECT * FROM test012; END ;; DELIMITER ; + +CREATE EVENT `test012_event` + ON SCHEDULE EVERY 1 DAY + ON COMPLETION PRESERVE ENABLE +DO begin + + select 1; +end; \ No newline at end of file