]> granicus.if.org Git - postgresql/commit
Fix partial aggregation for variance(int4) and related aggregates.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 21 Jun 2018 20:18:33 +0000 (16:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 21 Jun 2018 20:18:39 +0000 (16:18 -0400)
commitec4719cd155d1d58c8aa7c06c7ef24aef6e67622
tree0bc2efb8aece2b6af1418222bbbcbb9ebe575f5a
parente474c2b7e4b656895d6afcbd36857c9ebb0fcedd
Fix partial aggregation for variance(int4) and related aggregates.

A typo in numeric_poly_combine caused bogus results for queries using
it, but of course would only manifest if parallel aggregation is
performed.  Reported by Rajkumar Raghuwanshi.

David Rowley did the diagnosis and the fix; I editorialized rather
heavily on his regression test additions.

Back-patch to v10 where the breakage was introduced (by 9cca11c91).

Discussion: https://postgr.es/m/CAKcux6nU4E2x8nkSBpLOT2DPvQ5LviJ3SGyAN6Sz7qDH4G4+Pw@mail.gmail.com
src/backend/utils/adt/numeric.c
src/test/regress/expected/aggregates.out
src/test/regress/sql/aggregates.sql