Skip to content

Commit

Permalink
statistics: avoid update delta when delta modified count is 0 (#5164)
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood authored and jackysp committed Nov 21, 2017
1 parent f161bdc commit edcb9e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions statistics/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (h *Handle) DumpStatsDeltaToKV() {

// dumpTableStatDeltaToKV dumps a single delta with some table to KV and updates the version.
func (h *Handle) dumpTableStatDeltaToKV(id int64, delta variable.TableDelta) error {
if delta.Count == 0 {
return nil
}
_, err := h.ctx.(sqlexec.SQLExecutor).Execute("begin")
if err != nil {
return errors.Trace(err)
Expand Down

0 comments on commit edcb9e9

Please sign in to comment.