Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: avoid unlock of unlocked mutex panic on TableDeltaMap #57799

Merged
merged 10 commits into from
Dec 5, 2024
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