Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
utils: filter out EVENT (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Dec 18, 2020
1 parent d9b8c1a commit ac09bd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions syncer/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit ac09bd4

Please sign in to comment.