diff options
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
-rw-r--r-- | src/backend/utils/adt/numeric.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 201784bbf66..73be69c740c 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -3772,11 +3772,11 @@ numeric_combine(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state1); } + state1->N += state2->N; + state1->NaNcount += state2->NaNcount; + if (state2->N > 0) { - state1->N += state2->N; - state1->NaNcount += state2->NaNcount; - /* * These are currently only needed for moving aggregates, but let's do * the right thing anyway... @@ -3859,11 +3859,11 @@ numeric_avg_combine(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state1); } + state1->N += state2->N; + state1->NaNcount += state2->NaNcount; + if (state2->N > 0) { - state1->N += state2->N; - state1->NaNcount += state2->NaNcount; - /* * These are currently only needed for moving aggregates, but let's do * the right thing anyway... |