@@ -1905,9 +1905,9 @@ func TestNoStopAfterNonTargetColumnDrop(t *testing.T) {
1905
1905
1906
1906
// Check that dropping a watched column still stops the changefeed.
1907
1907
sqlDB .Exec (t , `ALTER TABLE hasfams DROP COLUMN b` )
1908
- if _ , err := cf .Next (); ! testutils . IsError ( err , `schema change occurred at` ) {
1909
- require .Regexp (t , `expected " schema change occurred at ..." got: %+v` , err )
1910
- }
1908
+ msg , err := cf .Next ()
1909
+ require .True (t , testutils . IsError ( err , ` schema change occurred at` ),
1910
+ `expected "schema change occurred at ..." got: msg=%s, err=%+v` , msg , err )
1911
1911
}
1912
1912
1913
1913
runWithAndWithoutRegression141453 (t , testFn , func (t * testing.T , testFn cdcTestFn ) {
@@ -2003,27 +2003,32 @@ func TestNoBackfillAfterNonTargetColumnDrop(t *testing.T) {
2003
2003
}
2004
2004
2005
2005
// Open up the changefeed.
2006
- cf := feed (t , f , `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c` , args ... )
2006
+ // We specify `updated` so that identical messages with different timestamps
2007
+ // aren't filtered out as duplicates. The appearance of such messages would
2008
+ // indicate that a backfill did happen even though it should not have.
2009
+ cf := feed (t , f , `CREATE CHANGEFEED FOR TABLE hasfams FAMILY b_and_c WITH updated` , args ... )
2007
2010
defer closeFeed (t , cf )
2008
- assertPayloads (t , cf , []string {
2011
+ assertPayloadsStripTs (t , cf , []string {
2009
2012
`hasfams.b_and_c: [0]->{"after": {"b": "b", "c": "c"}}` ,
2010
2013
})
2011
2014
2012
2015
sqlDB .Exec (t , `ALTER TABLE hasfams DROP COLUMN a` )
2013
2016
sqlDB .Exec (t , `INSERT INTO hasfams VALUES (1, 'b1', 'c1')` )
2014
- assertPayloads (t , cf , []string {
2017
+ assertPayloadsStripTs (t , cf , []string {
2015
2018
`hasfams.b_and_c: [1]->{"after": {"b": "b1", "c": "c1"}}` ,
2016
2019
})
2017
2020
2018
2021
// Check that dropping a watched column still backfills.
2019
2022
sqlDB .Exec (t , `ALTER TABLE hasfams DROP COLUMN c` )
2020
- assertPayloads (t , cf , []string {
2023
+ assertPayloadsStripTs (t , cf , []string {
2021
2024
`hasfams.b_and_c: [0]->{"after": {"b": "b"}}` ,
2022
2025
`hasfams.b_and_c: [1]->{"after": {"b": "b1"}}` ,
2023
2026
})
2024
2027
}
2025
2028
2026
- cdcTest (t , testFn )
2029
+ runWithAndWithoutRegression141453 (t , testFn , func (t * testing.T , testFn cdcTestFn ) {
2030
+ cdcTest (t , testFn )
2031
+ })
2027
2032
}
2028
2033
2029
2034
func TestChangefeedColumnDropsWithFamilyAndNonFamilyTargets (t * testing.T ) {
0 commit comments