Skip to content

Commit c9343f7

Browse files
committed
changefeedccl: fix TestNoBackfillAfterNonTargetColumnDrop
This patch fixes `TestNoBackfillAfterNonTargetColumnDrop` so that it actually checks that no backfills occur after a non-target column drop. Release note: None
1 parent b35bf70 commit c9343f7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,27 +1931,32 @@ func TestNoBackfillAfterNonTargetColumnDrop(t *testing.T) {
19311931
}
19321932

19331933
// Open up the changefeed.
1934-
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c`, args...)
1934+
// We specify `updated` so that identical messages with different timestamps
1935+
// aren't filtered out as duplicates. The appearance of such messages would
1936+
// indicate that a backfill did happen even though it should not have.
1937+
cf := feed(t, f, `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c WITH updated`, args...)
19351938
defer closeFeed(t, cf)
1936-
assertPayloads(t, cf, []string{
1939+
assertPayloadsStripTs(t, cf, []string{
19371940
`hasfams.b_and_c: [0]->{"after": {"b": "b", "c": "c"}}`,
19381941
})
19391942

19401943
sqlDB.Exec(t, `ALTER TABLE hasfams DROP COLUMN a`)
19411944
sqlDB.Exec(t, `INSERT INTO hasfams VALUES (1, 'b1', 'c1')`)
1942-
assertPayloads(t, cf, []string{
1945+
assertPayloadsStripTs(t, cf, []string{
19431946
`hasfams.b_and_c: [1]->{"after": {"b": "b1", "c": "c1"}}`,
19441947
})
19451948

19461949
// Check that dropping a watched column still backfills.
19471950
sqlDB.Exec(t, `ALTER TABLE hasfams DROP COLUMN c`)
1948-
assertPayloads(t, cf, []string{
1951+
assertPayloadsStripTs(t, cf, []string{
19491952
`hasfams.b_and_c: [0]->{"after": {"b": "b"}}`,
19501953
`hasfams.b_and_c: [1]->{"after": {"b": "b1"}}`,
19511954
})
19521955
}
19531956

1954-
cdcTest(t, testFn)
1957+
runWithAndWithoutRegression141453(t, testFn, func(t *testing.T, testFn cdcTestFn) {
1958+
cdcTest(t, testFn)
1959+
})
19551960
}
19561961

19571962
func TestChangefeedColumnDropsWithFamilyAndNonFamilyTargets(t *testing.T) {

0 commit comments

Comments
 (0)