DBZ-7718 Support table name escaping in BlockingSnapshotIT
This commit is contained in:
parent
ba2f893168
commit
1190389edc
@ -137,6 +137,11 @@ protected String signalTableName() {
|
|||||||
return tableNameId("debezium_signal").toQuotedString('`');
|
return tableNameId("debezium_signal").toQuotedString('`');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String escapedTableDataCollectionId() {
|
||||||
|
return String.format("\\\\\"%s\\\\\".\\\\\"%s\\\\\"", tableNameId().catalog(), tableNameId().table());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String signalTableNameSanitized() {
|
protected String signalTableNameSanitized() {
|
||||||
return DATABASE.qualifiedTableName("debezium_signal");
|
return DATABASE.qualifiedTableName("debezium_signal");
|
||||||
|
@ -110,6 +110,11 @@ protected String tableDataCollectionId() {
|
|||||||
return TestHelper.getDatabaseName() + ".DEBEZIUM.A";
|
return TestHelper.getDatabaseName() + ".DEBEZIUM.A";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String escapedTableDataCollectionId() {
|
||||||
|
return "\\\"" + TestHelper.getDatabaseName() + "\\\".\\\"DEBEZIUM\\\".\\\"A\\\"";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> tableDataCollectionIds() {
|
protected List<String> tableDataCollectionIds() {
|
||||||
return List.of(TestHelper.getDatabaseName() + ".DEBEZIUM.A", TestHelper.getDatabaseName() + ".DEBEZIUM.B");
|
return List.of(TestHelper.getDatabaseName() + ".DEBEZIUM.A", TestHelper.getDatabaseName() + ".DEBEZIUM.B");
|
||||||
|
@ -112,6 +112,11 @@ protected String signalTableName() {
|
|||||||
return "s1.debezium_signal";
|
return "s1.debezium_signal";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String escapedTableDataCollectionId() {
|
||||||
|
return "\\\"s1\\\".\\\"a\\\"";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String connector() {
|
protected String connector() {
|
||||||
return "postgres";
|
return "postgres";
|
||||||
|
@ -88,6 +88,11 @@ protected String signalTableName() {
|
|||||||
return "dbo.debezium_signal";
|
return "dbo.debezium_signal";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String escapedTableDataCollectionId() {
|
||||||
|
return "\\\"testDB1\\\".\\\"dbo\\\".\\\"a\\\"";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Configuration.Builder config() {
|
protected Configuration.Builder config() {
|
||||||
return TestHelper.defaultConfig()
|
return TestHelper.defaultConfig()
|
||||||
|
@ -57,6 +57,8 @@ public abstract class AbstractBlockingSnapshotTest extends AbstractSnapshotTest
|
|||||||
@Override
|
@Override
|
||||||
protected abstract String tableName();
|
protected abstract String tableName();
|
||||||
|
|
||||||
|
protected abstract String escapedTableDataCollectionId();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected abstract String connector();
|
protected abstract String connector();
|
||||||
|
|
||||||
@ -202,7 +204,7 @@ public void executeBlockingSnapshotWithEscapedCollectionName() throws Exception
|
|||||||
SourceRecords consumedRecordsByTopic = consumeRecordsByTopic(ROW_COUNT * 2, 10);
|
SourceRecords consumedRecordsByTopic = consumeRecordsByTopic(ROW_COUNT * 2, 10);
|
||||||
assertRecordsFromSnapshotAndStreamingArePresent(ROW_COUNT * 2, consumedRecordsByTopic);
|
assertRecordsFromSnapshotAndStreamingArePresent(ROW_COUNT * 2, consumedRecordsByTopic);
|
||||||
|
|
||||||
sendAdHocSnapshotSignalWithAdditionalConditionWithSurrogateKey("", "", BLOCKING, "\\\"s1\\\".\\\"a\\\"");
|
sendAdHocSnapshotSignalWithAdditionalConditionWithSurrogateKey("", "", BLOCKING, escapedTableDataCollectionId());
|
||||||
|
|
||||||
waitForLogMessage("Snapshot completed", AbstractSnapshotChangeEventSource.class);
|
waitForLogMessage("Snapshot completed", AbstractSnapshotChangeEventSource.class);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user