Skip to content

Commit

Permalink
Check results instead of err when both are present
Browse files Browse the repository at this point in the history
Signed-off-by: Rafer Hazen <[email protected]>
  • Loading branch information
rafer committed Jul 25, 2024
1 parent 8e9bccb commit 5ef68ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/vt/vtgate/engine/fk_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (f *FkVerify) TryExecute(ctx context.Context, vcursor VCursor, bindVars map
}

result, err := vcursor.ExecutePrimitive(ctx, f.Exec, bindVars, wantfields)
if err == nil {
if result != nil {
result.MergeStats(stats)
}
return result, err
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/engine/insert_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (ins *InsertSelect) execInsertSharded(ctx context.Context, vcursor VCursor,
}

result, err := ins.insertIntoShardedTable(ctx, vcursor, bindVars, selectResult)
if err == nil {
if result != nil {
result.MergeStats(selectResult.stats)
}

Expand Down

0 comments on commit 5ef68ca

Please sign in to comment.