Skip to content

Commit

Permalink
use maxRows, wantFields
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Mar 18, 2024
1 parent c4385a0 commit 8485c2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions go/vt/vttablet/tabletmanager/rpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ func (tm *TabletManager) ExecuteMultiFetchAsDba(ctx context.Context, req *tablet
// (in v20): result, err := ExecuteFetch(uq, int(req.MaxRows), true /*wantFields*/)
results := make([]*querypb.QueryResult, 0, len(queries))
result, more, err := conn.ExecuteFetchMulti(uq, int(req.MaxRows), true /*wantFields*/)
results = append(results, sqltypes.ResultToProto3(result))
for more {
result, more, _, err = conn.ReadQueryResult(0, false)
if err == nil {
results = append(results, sqltypes.ResultToProto3(result))
}
for more {
result, more, _, err = conn.ReadQueryResult(int(req.MaxRows), true /*wantFields*/)
if err != nil {
return nil, err
}
results = append(results, sqltypes.ResultToProto3(result))
}

// Re-enable FK checks if necessary.
Expand Down

0 comments on commit 8485c2e

Please sign in to comment.