Skip to content

Commit

Permalink
go/vt/wrangler: fix nilness issues and unused variable (vitessio#14710)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlayher authored and ejortegau committed Dec 13, 2023
1 parent 529f300 commit 7fc6a9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
10 changes: 4 additions & 6 deletions go/vt/wrangler/materializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,11 @@ func (wr *Wrangler) MoveTables(ctx context.Context, workflow, sourceKeyspace, ta
return err
}
}
if vschema != nil {
// We added to the vschema.
if err := wr.ts.SaveVSchema(ctx, targetKeyspace, vschema); err != nil {
return err
}
}

// We added to the vschema.
if err := wr.ts.SaveVSchema(ctx, targetKeyspace, vschema); err != nil {
return err
}
}
if err := wr.ts.RebuildSrvVSchema(ctx, nil); err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions go/vt/wrangler/traffic_switcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -1920,9 +1920,6 @@ func (ts *trafficSwitcher) addParticipatingTablesToKeyspace(ctx context.Context,
if err := json2.Unmarshal([]byte(wrap), ks); err != nil {
return err
}
if err != nil {
return err
}
for table, vtab := range ks.Tables {
vschema.Tables[table] = vtab
}
Expand Down
7 changes: 2 additions & 5 deletions go/vt/wrangler/vexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,6 @@ func (wr *Wrangler) getReplicationStatusFromRow(ctx context.Context, row sqltype
workflowSubType, _ = row.ToInt32("workflow_sub_type")
deferSecondaryKeys, _ = row.ToBool("defer_secondary_keys")
rowsCopied = row.AsInt64("rows_copied", 0)
if err != nil {
return nil, "", err
}

status := &ReplicationStatus{
Shard: primary.Shard,
Expand Down Expand Up @@ -701,8 +698,8 @@ func (wr *Wrangler) getStreams(ctx context.Context, workflow, keyspace string) (
var rsr ReplicationStatusResult
rsr.ShardStatuses = make(map[string]*ShardReplicationStatus)
rsr.Workflow = workflow
var results map[*topo.TabletInfo]*querypb.QueryResult
query := `select

const query = `select
id,
source,
pos,
Expand Down

0 comments on commit 7fc6a9a

Please sign in to comment.