Skip to content

Commit

Permalink
rowexec: use the sorter's own context
Browse files Browse the repository at this point in the history
Release note: none
  • Loading branch information
yuzefovich committed Aug 9, 2022
1 parent 8bcd0cd commit adac512
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/sql/rowexec/sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ func (s *sortAllProcessor) Start(ctx context.Context) {
// drain if it's not recoverable. It is possible for ok to be false even if no
// error is returned - in case an error metadata was received.
func (s *sortAllProcessor) fill() (ok bool, _ error) {
ctx := s.EvalCtx.Ctx()

for {
row, meta := s.input.Next()
if meta != nil {
Expand All @@ -252,13 +250,13 @@ func (s *sortAllProcessor) fill() (ok bool, _ error) {
break
}

if err := s.rows.AddRow(ctx, row); err != nil {
if err := s.rows.AddRow(s.Ctx, row); err != nil {
return false, err
}
}
s.rows.Sort(ctx)
s.rows.Sort(s.Ctx)

s.i = s.rows.NewFinalIterator(ctx)
s.i = s.rows.NewFinalIterator(s.Ctx)
s.i.Rewind()
return true, nil
}
Expand Down

0 comments on commit adac512

Please sign in to comment.