Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Oct 3, 2024
1 parent 5007897 commit 4aa4362
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ func (e *IndexLookUpExecutor) Open(ctx context.Context) error {
return err
}
}

if e.memTracker != nil {
e.memTracker.Reset()
} else {
e.memTracker = memory.NewTracker(e.ID(), -1)
}
e.memTracker.AttachTo(e.stmtMemTracker)

err = e.buildTableKeyRanges()
if err != nil {
return err
Expand Down Expand Up @@ -921,6 +929,10 @@ func (e *IndexLookUpExecutor) Close() error {
e.finished = nil
e.workerStarted = false
e.resultCurr = nil

if e.memTracker != nil {
e.memTracker.Reset()
}
return nil
}

Expand Down

0 comments on commit 4aa4362

Please sign in to comment.