diff --git a/bindinfo/stat.go b/bindinfo/stat.go index 1e63fcc478912..aea98669002d1 100644 --- a/bindinfo/stat.go +++ b/bindinfo/stat.go @@ -28,6 +28,10 @@ func (h *BindHandle) GetScope(status string) variable.ScopeFlag { // Stats returns the server statistics. func (h *BindHandle) Stats(vars *variable.SessionVars) (map[string]interface{}, error) { + h.bindInfo.Lock() + defer func() { + h.bindInfo.Unlock() + }() m := make(map[string]interface{}) m[lastPlanBindingUpdateTime] = h.bindInfo.lastUpdateTime.String()