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 f3a725271e6..553e261ed00 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -3967,11 +3967,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... @@ -4054,11 +4054,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... |