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 Feb 7, 2025
1 parent f7c54b0 commit b5c86f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3181,8 +3181,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 b5c86f5

Please sign in to comment.