diff --git a/session/session.go b/session/session.go index 95822c17811a0..0e28507c043e9 100644 --- a/session/session.go +++ b/session/session.go @@ -1598,7 +1598,7 @@ func (s *session) SetProcessInfo(sql string, t time.Time, command byte, maxExecu } } // We set process info before building plan, so we extended execution time. - if oldPi != nil && oldPi.Info == pi.Info { + if oldPi != nil && oldPi.Info == pi.Info && oldPi.Command == pi.Command { pi.Time = oldPi.Time } _, digest := s.sessionVars.StmtCtx.SQLDigest()