Skip to content

Commit

Permalink
*: avoid unlock of unlocked mutex panic on TableDeltaMap (#57799) (#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Dec 5, 2024
1 parent 012bfdd commit 2f9739a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3775,8 +3775,9 @@ func (s *SessionVars) GetNegateStrMatchDefaultSelectivity() float64 {

// GetRelatedTableForMDL gets the related table for metadata lock.
func (s *SessionVars) GetRelatedTableForMDL() *sync.Map {
s.TxnCtx.tdmLock.Lock()
defer s.TxnCtx.tdmLock.Unlock()
mu := &s.TxnCtx.tdmLock
mu.Lock()
defer mu.Unlock()
if s.TxnCtx.relatedTableForMDL == nil {
s.TxnCtx.relatedTableForMDL = new(sync.Map)
}
Expand Down

0 comments on commit 2f9739a

Please sign in to comment.