Skip to content

Commit

Permalink
executor: fix wrong ConnID for query out of memory quota (#47980)
Browse files Browse the repository at this point in the history
close #47979
  • Loading branch information
wshwsh12 authored Oct 26, 2023
1 parent d4b81de commit fd08ae3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@ func ResetContextOfStmt(ctx sessionctx.Context, s ast.StmtNode) (err error) {
vars.MemTracker.Killer = &vars.SQLKiller
vars.DiskTracker.Killer = &vars.SQLKiller
vars.SQLKiller.Reset()
vars.SQLKiller.ConnID = vars.ConnectionID
vars.StmtCtx.TableStats = make(map[int64]interface{})

isAnalyze := false
Expand Down
1 change: 0 additions & 1 deletion pkg/sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,6 @@ func NewSessionVars(hctx HookContext) *SessionVars {
vars.DiskTracker = disk.NewTracker(memory.LabelForSession, -1)
vars.MemTracker = memory.NewTracker(memory.LabelForSession, vars.MemQuotaQuery)
vars.MemTracker.IsRootTrackerOfSess = true
vars.SQLKiller.ConnID = vars.ConnectionID
vars.MemTracker.Killer = &vars.SQLKiller

for _, engine := range config.GetGlobalConfig().IsolationRead.Engines {
Expand Down

0 comments on commit fd08ae3

Please sign in to comment.