Skip to content

Commit 6b720cc

Browse files
hawkingreiti-chi-bot
authored andcommitted
This is an automated cherry-pick of pingcap#55842
Signed-off-by: ti-chi-bot <[email protected]>
1 parent d00c55f commit 6b720cc

File tree

3 files changed

+148
-1
lines changed

3 files changed

+148
-1
lines changed

pkg/statistics/table.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,11 @@ func (coll *HistColl) GetScaledRealtimeAndModifyCnt(idxStats *Index) (realtimeCn
596596
if analyzeRowCount <= 0 {
597597
return coll.RealtimeCount, coll.ModifyCount
598598
}
599-
scale := idxStats.TotalRowCount() / analyzeRowCount
599+
idxTotalRowCount := idxStats.TotalRowCount()
600+
if idxTotalRowCount <= 0 {
601+
return coll.RealtimeCount, coll.ModifyCount
602+
}
603+
scale := idxTotalRowCount / analyzeRowCount
600604
return int64(float64(coll.RealtimeCount) * scale), int64(float64(coll.ModifyCount) * scale)
601605
}
602606

tests/integrationtest/r/planner/core/issuetest/planner_issue.result

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

tests/integrationtest/t/planner/core/issuetest/planner_issue.test

Lines changed: 62 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)