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 Dec 5, 2024
1 parent da965d1 commit 12b9421
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 @@ -3778,8 +3778,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 12b9421

Please sign in to comment.