Skip to content

Commit

Permalink
Update tests now that we check BinlogSource when externalizing lookup…
Browse files Browse the repository at this point in the history
… vindexes

Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored and vbalys committed Sep 22, 2023
1 parent b4e50ec commit 5d8fa9a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions go/vt/wrangler/materializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1560,11 +1560,13 @@ func TestExternalizeVindex(t *testing.T) {
},
}
fields := sqltypes.MakeTestFields(
"id|state|message",
"int64|varbinary|varbinary",
"id|state|message|source",
"int64|varbinary|varbinary|blob",
)
running := sqltypes.MakeTestResult(fields, "1|Running|msg")
stopped := sqltypes.MakeTestResult(fields, "1|Stopped|Stopped after copy")
sourceStopAfterCopy := `keyspace:"sourceKs",shard:"0",filter:{rules:{match:"owned" filter:"select * from t1 where in_keyrange(col1, 'sourceKs.hash', '-80')"}} stop_after_copy:true`
sourceKeepRunningAfterCopy := `keyspace:"sourceKs",shard:"0",filter:{rules:{match:"owned" filter:"select * from t1 where in_keyrange(col1, 'sourceKs.hash', '-80')"}}`
running := sqltypes.MakeTestResult(fields, "1|Running|msg|"+sourceKeepRunningAfterCopy)
stopped := sqltypes.MakeTestResult(fields, "1|Stopped|Stopped after copy|"+sourceStopAfterCopy)
testcases := []struct {
input string
vrResponse *sqltypes.Result
Expand All @@ -1587,9 +1589,9 @@ func TestExternalizeVindex(t *testing.T) {
input: "sourceks.bad",
err: "table name in vindex should be of the form keyspace.table: unqualified",
}, {
input: "sourceks.owned",
vrResponse: running,
err: "is not in Stopped after copy state",
input: "sourceks.owned",
vrResponse: running,
expectDelete: true,
}, {
input: "sourceks.unowned",
vrResponse: stopped,
Expand All @@ -1601,7 +1603,7 @@ func TestExternalizeVindex(t *testing.T) {
t.Fatal(err)
}
if tcase.vrResponse != nil {
validationQuery := "select id, state, message from _vt.vreplication where workflow='lkp_vdx' and db_name='vt_targetks'"
validationQuery := "select id, state, message, source from _vt.vreplication where workflow='lkp_vdx' and db_name='vt_targetks'"
env.tmc.expectVRQuery(200, validationQuery, tcase.vrResponse)
env.tmc.expectVRQuery(210, validationQuery, tcase.vrResponse)
}
Expand Down

0 comments on commit 5d8fa9a

Please sign in to comment.