Skip to content

Commit

Permalink
re-use the usedStatsInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <[email protected]>
  • Loading branch information
YangKeao committed Jan 17, 2025
1 parent 889bf45 commit a1160da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sessionctx/stmtctx/stmtctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ func NewStmtCtxWithTimeZone(tz *time.Location) *StatementContext {

// Reset resets a statement context
func (sc *StatementContext) Reset() {
usedStats := sc.usedStatsInfo.Load()
usedStats.store.Clear()

*sc = StatementContext{
ctxID: contextutil.GenContextID(),
CTEStorageMap: sc.CTEStorageMap,
Expand All @@ -494,6 +497,7 @@ func (sc *StatementContext) Reset() {
} else {
sc.ExtraWarnHandler = contextutil.NewStaticWarnHandler(0)
}
sc.usedStatsInfo.Store(usedStats)
}

// CtxID returns the context id of the statement
Expand Down

0 comments on commit a1160da

Please sign in to comment.