diff --git a/pkg/utils/util.go b/pkg/utils/util.go index 408d93227c..2b8d13bc2d 100644 --- a/pkg/utils/util.go +++ b/pkg/utils/util.go @@ -77,6 +77,11 @@ var ( "^ALTER\\s+TABLESPACE", "^DROP\\s+TABLESPACE", + // event + "^CREATE\\s+(DEFINER\\s?=.+?)?EVENT", + "^ALTER\\s+(DEFINER\\s?=.+?)?EVENT", + "^DROP\\s+EVENT", + // account management "^GRANT", "^REVOKE", diff --git a/syncer/filter_test.go b/syncer/filter_test.go index 1a6bc3b1b7..5dce9f42cc 100644 --- a/syncer/filter_test.go +++ b/syncer/filter_test.go @@ -95,6 +95,11 @@ END`, true}, {"ALTER TABLESPACE `ts1` DROP DATAFILE 'ts1.idb' ENGIEN=NDB", true}, {"DROP TABLESPACE ts1", true}, + // event + {"CREATE DEFINER=CURRENT_USER EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO UPDATE myschema.mytable SET mycol = mycol + 1;", true}, + {"ALTER DEFINER = CURRENT_USER EVENT myevent ON SCHEDULE EVERY 12 HOUR STARTS CURRENT_TIMESTAMP + INTERVAL 4 HOUR;", true}, + {"DROP EVENT myevent;", true}, + // account management {"CREATE USER 't'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*93E34F4B81FEC9E8271655EA87646ED01AF377CC'", true}, {"ALTER USER 't'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*1114744159A0EF13B12FC371C94877763F9512D0'", true},