postgresql/src/backend
Tom Lane ac4a9d92fc Fix incorrect handling of polymorphic aggregates used as window functions.
The transfunction was told that its first argument and result were
of the window function output type, not the aggregate state type.
This'd only matter if the transfunction consults get_fn_expr_argtype,
which typically only polymorphic functions would do.

Although we have several regression tests around polymorphic aggs,
none of them detected this mistake --- in fact, they still didn't
fail when I injected the same mistake into nodeAgg.c.  So add some
more tests covering both plain agg and window-function-agg cases.

Per report from Sebastian Luque.  Back-patch to 9.6 where the error
was introduced (by sloppy refactoring in commit 804163bc2, looks like).

Report: <87int2qkat.fsf@gmail.com>
2016-10-09 12:49:37 -04:00
..
access Extend framework from commit 53be0b1ad to report latch waits. 2016-10-04 11:01:42 -04:00
bootstrap Fix a bunch of places that called malloc and friends with no NULL check. 2016-08-30 18:22:43 -04:00
catalog Fix two bugs in merging of inherited CHECK constraints. 2016-10-08 19:29:27 -04:00
commands Fix two bugs in merging of inherited CHECK constraints. 2016-10-08 19:29:27 -04:00
executor Fix incorrect handling of polymorphic aggregates used as window functions. 2016-10-09 12:49:37 -04:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Clarify the new Red-Black post-order traversal code a bit. 2016-09-04 15:02:06 +03:00
libpq Extend framework from commit 53be0b1ad to report latch waits. 2016-10-04 11:01:42 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Add debugging aid "bmsToString(Bitmapset *bms)". 2016-09-16 09:36:24 -04:00
optimizer Disallow pushing volatile quals past set-returning functions. 2016-09-27 18:43:36 -04:00
parser Add ALTER EXTENSION ADD/DROP ACCESS METHOD, and use it in pg_upgrade. 2016-10-02 14:31:28 -04:00
po Translation updates 2016-08-08 11:08:00 -04:00
port Fix fallback implementation of pg_atomic_write_u32(). 2016-10-07 16:55:15 -07:00
postmaster Re-alphabetize #include directives. 2016-10-05 08:24:25 -04:00
regex Make locale-dependent regex character classes work for large char codes. 2016-09-05 17:06:29 -04:00
replication libpqwalreceiver needs to link with libintl when using --enable-nls. 2016-10-07 21:12:25 -04:00
rewrite Improve parser's and planner's handling of set-returning functions. 2016-09-13 13:54:24 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Fix fallback implementation of pg_atomic_write_u32(). 2016-10-07 16:55:15 -07:00
tcop Add location field to DefElem 2016-09-06 12:00:00 -04:00
tsearch Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
utils Remove bogus mapping from UTF-8 to SJIS conversion table. 2016-10-07 23:56:42 +03:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00