Skip to content

Commit

Permalink
variable: fix data race in GetTemporaryTable (pingcap#55338)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcwangchao authored Aug 9, 2024
1 parent 240702e commit 2675c66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2765,6 +2765,8 @@ func (s *SessionVars) GetDivPrecisionIncrement() int {
// GetTemporaryTable returns a TempTable by tableInfo.
func (s *SessionVars) GetTemporaryTable(tblInfo *model.TableInfo) tableutil.TempTable {
if tblInfo.TempTableType != model.TempTableNone {
s.TxnCtxMu.Lock()
defer s.TxnCtxMu.Unlock()
if s.TxnCtx.TemporaryTables == nil {
s.TxnCtx.TemporaryTables = make(map[int64]tableutil.TempTable)
}
Expand Down

0 comments on commit 2675c66

Please sign in to comment.