Skip to content

Commit

Permalink
fix: return 0 when no result in sum()
Browse files Browse the repository at this point in the history
  • Loading branch information
teckick committed Nov 19, 2019
1 parent bcc9542 commit 9c08ae7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proxy/plan/merge_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ func (a *AggregateFuncSumMerger) MergeTo(from, to ResultRow) error {
return fmt.Errorf("field index out of bound: %d", a.fieldIndex)
}

fromValueI := from.GetValue(idx)

// nil对应NULL, NULL不参与比较
if fromValueI == nil {
return nil
}

switch to.GetValue(idx).(type) {
case int64:
return a.sumToInt64(from, to)
Expand Down

0 comments on commit 9c08ae7

Please sign in to comment.