Skip to content

Commit

Permalink
*: tiny refactor, more go idiom (pingcap#9660)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaut authored and coocood committed Mar 12, 2019
1 parent 7d0b660 commit 52c8267
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,11 +1287,10 @@ func (e *UnionExec) Close() error {
// Before every execution, we must clear statement context.
func ResetContextOfStmt(ctx sessionctx.Context, s ast.StmtNode) (err error) {
vars := ctx.GetSessionVars()
sc := new(stmtctx.StatementContext)
sc.TimeZone = vars.Location()
sc.MemTracker = memory.NewTracker(s.Text(), vars.MemQuotaQuery)
sc.NowTs = time.Time{}
sc.SysTs = time.Time{}
sc := &stmtctx.StatementContext{
TimeZone: vars.Location(),
MemTracker: memory.NewTracker(s.Text(), vars.MemQuotaQuery),
}
switch config.GetGlobalConfig().OOMAction {
case config.OOMActionCancel:
sc.MemTracker.SetActionOnExceed(&memory.PanicOnExceed{})
Expand Down
1 change: 0 additions & 1 deletion util/memory/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func NewTracker(label string, bytesLimit int64) *Tracker {
label: label,
bytesLimit: bytesLimit,
actionOnExceed: &LogOnExceed{},
parent: nil,
}
}

Expand Down

0 comments on commit 52c8267

Please sign in to comment.