Skip to content

Commit

Permalink
*: avoid unlock of unlocked mutex panic on TableDeltaMap (#57799)
Browse files Browse the repository at this point in the history
close #57798
  • Loading branch information
tiancaiamao authored and ti-chi-bot committed Feb 17, 2025
1 parent 5ac7f18 commit 289c6b1
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 @@ -3611,8 +3611,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 289c6b1

Please sign in to comment.