Skip to content

Commit

Permalink
stats, plan: return row count 0 for empty range on handle (#7583)
Browse files Browse the repository at this point in the history
  • Loading branch information
eurekaka authored and alivxxx committed Sep 3, 2018
1 parent 1f2841f commit 621ca43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion statistics/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func (t *Table) ColumnEqualRowCount(sc *stmtctx.StatementContext, value types.Da
func (coll *HistColl) GetRowCountByIntColumnRanges(sc *stmtctx.StatementContext, colID int64, intRanges []*ranger.Range) (float64, error) {
if coll.ColumnIsInvalid(sc, colID) {
if len(intRanges) == 0 {
return float64(coll.Count), nil
return 0, nil
}
if intRanges[0].LowVal[0].Kind() == types.KindInt64 {
return getPseudoRowCountBySignedIntRanges(intRanges, float64(coll.Count)), nil
Expand Down

0 comments on commit 621ca43

Please sign in to comment.