From 675aeedf51595322a81cfb5cef3ee558a734d83b Mon Sep 17 00:00:00 2001 From: Ben Osheroff Date: Fri, 29 May 2015 14:11:51 -0700 Subject: [PATCH 1/2] ignore SET PASSWORD --- src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java b/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java index daf0234ec..bd88bfe72 100644 --- a/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java +++ b/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java @@ -32,6 +32,7 @@ public abstract class SchemaChange { SQL_BLACKLIST.add(Pattern.compile("^(ALTER|CREATE|DROP)\\s+((ONLINE|OFFLINE|UNIQUE|FULLTEXT|SPATIAL)\\s+)*(INDEX)", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^ANALYZE\\s+TABLE", Pattern.CASE_INSENSITIVE)); + SQL_BLACKLIST.add(Pattern.compile("^SET\\s+PASSWORD", Pattern.CASE_INSENSITIVE)); } private static boolean matchesBlacklist(String sql) { From 9a2e208d0d58a62f63ba684b77da8acfa4c77b61 Mon Sep 17 00:00:00 2001 From: Ben Osheroff Date: Fri, 29 May 2015 14:16:31 -0700 Subject: [PATCH 2/2] also ignore create user, REVOKE --- src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java b/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java index bd88bfe72..8a0c8b7fc 100644 --- a/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java +++ b/src/main/java/com/zendesk/maxwell/schema/ddl/SchemaChange.java @@ -26,6 +26,7 @@ public abstract class SchemaChange { SQL_BLACKLIST.add(Pattern.compile("^COMMIT", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^FLUSH", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^GRANT", Pattern.CASE_INSENSITIVE)); + SQL_BLACKLIST.add(Pattern.compile("^REVOKE\\s+", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^SAVEPOINT", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^(ALTER|CREATE)\\s+(DEFINER=[^\\s]+\\s+)?(FUNCTION|TRIGGER|PROCEDURE|VIEW)", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^DROP\\s+(FUNCTION|TRIGGER|PROCEDURE|VIEW)", Pattern.CASE_INSENSITIVE)); @@ -33,6 +34,7 @@ public abstract class SchemaChange { SQL_BLACKLIST.add(Pattern.compile("^(ALTER|CREATE|DROP)\\s+((ONLINE|OFFLINE|UNIQUE|FULLTEXT|SPATIAL)\\s+)*(INDEX)", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^ANALYZE\\s+TABLE", Pattern.CASE_INSENSITIVE)); SQL_BLACKLIST.add(Pattern.compile("^SET\\s+PASSWORD", Pattern.CASE_INSENSITIVE)); + SQL_BLACKLIST.add(Pattern.compile("^(CREATE|DROP|RENAME)\\s+USER", Pattern.CASE_INSENSITIVE)); } private static boolean matchesBlacklist(String sql) {