Skip to content

Commit

Permalink
*: avoid unlock of unlocked mutex panic on TableDeltaMap (pingcap#57799)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and ti-chi-bot committed Dec 10, 2024
1 parent b298e21 commit 4df91b3
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 @@ -3553,8 +3553,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 4df91b3

Please sign in to comment.