diff --git a/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/RecordsSnapshotProducerIT.java b/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/RecordsSnapshotProducerIT.java index 2815ef52c..0b1f2c41a 100644 --- a/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/RecordsSnapshotProducerIT.java +++ b/debezium-connector-postgres/src/test/java/io/debezium/connector/postgresql/RecordsSnapshotProducerIT.java @@ -1226,6 +1226,27 @@ public void shouldIncludePartitionedTableIntoSnapshot() throws Exception { .forEach(i -> VerifyRecord.isValidRead(recordsForTopicPart.remove(0), PK_FIELD, expectedPks[i])); } + @Test + @FixFor("DBZ-6669") + public void shouldGenerateSnapshotWhenSignalDataCollectionIsPresentWithoutTableIncludeList() throws Exception { + + TestHelper.dropAllSchemas(); + TestHelper.execute("CREATE TABLE t1 (pk SERIAL, aa integer, PRIMARY KEY(pk)); INSERT INTO t1 VALUES (default, 11)"); + + buildWithStreamProducer(TestHelper.defaultConfig() + .with(PostgresConnectorConfig.SNAPSHOT_MODE, PostgresConnectorConfig.SnapshotMode.INITIAL) + .with(PostgresConnectorConfig.SIGNAL_DATA_COLLECTION, "public.debezium_signal") + .with(PostgresConnectorConfig.INCLUDE_SCHEMA_CHANGES, true)); + + TestConsumer consumer = testConsumer(1); + + consumer.await(TestHelper.waitTimeForRecords(), TimeUnit.SECONDS); + + final SourceRecord first = consumer.remove(); + VerifyRecord.isValidRead(first, PK_FIELD, 1); + assertRecordOffsetAndSnapshotSource(first, SnapshotRecord.LAST); + } + private void buildNoStreamProducer(Configuration.Builder config) { alterConfig(config); start(PostgresConnector.class, config diff --git a/debezium-core/src/main/java/io/debezium/relational/RelationalSnapshotChangeEventSource.java b/debezium-core/src/main/java/io/debezium/relational/RelationalSnapshotChangeEventSource.java index 1d8cc9ea6..30e720a13 100644 --- a/debezium-core/src/main/java/io/debezium/relational/RelationalSnapshotChangeEventSource.java +++ b/debezium-core/src/main/java/io/debezium/relational/RelationalSnapshotChangeEventSource.java @@ -74,6 +74,7 @@ public abstract class RelationalSnapshotChangeEventSource
toTableIds(Set