Skip to content

Commit cd1c77c

Browse files
author
Nageswaran Sokkayaraj
committed
if the table tablename has backtick \`, then it has an issue in matching with exclude list
1 parent 84f5723 commit cd1c77c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

mysql-replicator-augmenter/src/main/java/com/booking/replication/augmenter/AugmenterContext.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,21 @@ private void processQueryEvent(RawEventHeaderV4 eventHeader, RawEventData eventD
480480
LOG.info("Skipping DDL TABLE event due to mismatching schemas. Next LOG.info line contains the relevant query");
481481
}
482482

483-
LOG.info("Table DDL Encountered: { db => " + queryRawEventData.getDatabase() + ", sql => " + queryRawEventData.getSQL());
484483
shouldProcess = shouldProcess && ( queryRawEventData.getDatabase().equals(replicatedSchema) );
485484
String eventType = matcher.group(2).toUpperCase();
486485
String tableName = matcher.group(4);
486+
487+
if (tableName.startsWith("`") && tableName.endsWith("`")) {
488+
tableName = tableName.substring(1, tableName.length() -1);
489+
}
490+
491+
if (shouldProcess) {
492+
shouldProcess = this.shouldAugmentTable(tableName);
493+
if (!shouldProcess) {
494+
LOG.info("Skipping DDL event as the table is part of exclude list. The query is : " + queryRawEventData.getSQL());
495+
}
496+
}
497+
487498
this.updateCommons(
488499
shouldProcess,
489500
QueryAugmentedEventDataType.DDL_TABLE,

0 commit comments

Comments
 (0)