DBZ-5423 Update the test case & document the changes
This commit is contained in:
parent
9b9f41369a
commit
22f260e09d
@ -2703,18 +2703,26 @@ public void verifyRenameTable() throws Exception {
|
||||
recordsForTopic = records.recordsForTopic("server1.testDB1.dbo.account");
|
||||
recordsForNewTableTopic = records.recordsForTopic("server1.testDB1.dbo.account_new");
|
||||
|
||||
final Schema expectedSchemaAfter = SchemaBuilder.struct()
|
||||
.optional()
|
||||
.name("server1.testDB1.dbo.account_new.Value")
|
||||
.field("id", Schema.INT32_SCHEMA)
|
||||
.field("name", Schema.OPTIONAL_STRING_SCHEMA)
|
||||
.field("amount", Schema.OPTIONAL_INT32_SCHEMA)
|
||||
.build();
|
||||
|
||||
// Assert state
|
||||
assertThat(recordsForTopic).hasSize(1);
|
||||
assertThat(recordsForNewTableTopic).isNull();
|
||||
assertThat(recordsForTopic).isNull();
|
||||
assertThat(recordsForNewTableTopic).hasSize(1);
|
||||
assertNoRecordsToConsume();
|
||||
|
||||
SourceRecordAssert.assertThat(recordsForTopic.get(0))
|
||||
SourceRecordAssert.assertThat(recordsForNewTableTopic.get(0))
|
||||
.valueAfterFieldIsEqualTo(
|
||||
new Struct(expectedSchema)
|
||||
new Struct(expectedSchemaAfter)
|
||||
.put("id", 12)
|
||||
.put("name", "some_value2")
|
||||
.put("amount", 241))
|
||||
.valueAfterFieldSchemaIsEqualTo(expectedSchema);
|
||||
.valueAfterFieldSchemaIsEqualTo(expectedSchemaAfter);
|
||||
|
||||
stopConnector();
|
||||
}
|
||||
|
@ -2700,6 +2700,12 @@ That is, columns that were previously defined as optional (or `NULL`) continue t
|
||||
Similarly, columns that had been defined as required (`NOT NULL`), retain that designation, although they are now defined as `NULL`.
|
||||
====
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
After you rename a table using `sp_rename` function, it will continue to emit changes under the old source table name until the connector is restarted.
|
||||
Upon restart of the connector, it will emit changes under the new source table name.
|
||||
====
|
||||
|
||||
// Type: procedure
|
||||
// ModuleID: debezium-sql-server-connector-running-an-offline-update-after-a-schema-change
|
||||
// Title: Running an offline update after a schema change
|
||||
|
Loading…
Reference in New Issue
Block a user