Do not log FLUSH RELAY LOGS statements

This commit is contained in:
Jiri Pechanec 2018-03-16 06:37:53 +01:00 committed by Gunnar Morling
parent 469199350f
commit 62c7fe12f9
2 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,9 @@ public interface DatabaseHistory {
.withDefault(
"DROP TEMPORARY TABLE IF EXISTS .+ /\\* generated by server \\*/," +
// Filter out RDS heartbeat statements, see DBZ-469
"INSERT INTO mysql.rds_heartbeat2\\(.*\\) values \\(.*\\) ON DUPLICATE KEY UPDATE value = .*"
"INSERT INTO mysql.rds_heartbeat2\\(.*\\) values \\(.*\\) ON DUPLICATE KEY UPDATE value = .*," +
"FLUSH RELAY LOGS.*," +
"flush relay logs.*"
)
.withWidth(Width.LONG)
.withImportance(Importance.LOW)

View File

@ -135,4 +135,12 @@ public void defaultDddlFilterShouldFilterOutRdsHeartbeatInsert() {
Predicate<String> ddlFilter = Predicates.includes(defaultDdlFilter);
assertThat(ddlFilter.test("INSERT INTO mysql.rds_heartbeat2(id, value) values (1,1510678117058) ON DUPLICATE KEY UPDATE value = 1510678117058")).isTrue();
}
@Test
@FixFor("DBZ-661")
public void defaultDddlFilterShouldFilterOutFlushRelayLogs() {
String defaultDdlFilter = Configuration.create().build().getString(DatabaseHistory.DDL_FILTER);
Predicate<String> ddlFilter = Predicates.includes(defaultDdlFilter);
assertThat(ddlFilter.test("FLUSH RELAY LOGS")).isTrue();
}
}