diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-10-09 12:49:37 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-10-09 12:49:37 -0400 |
commit | ac4a9d92fcb6869e757cc729dca2ca5ccf94b185 (patch) | |
tree | 890afd89acea19523b7262f3074cbd4009cccb27 /src/backend/executor/nodeWindowAgg.c | |
parent | e55a946a81c6648c5ff3a0ccdda242f639e33c6f (diff) | |
download | postgresql-ac4a9d92fcb6869e757cc729dca2ca5ccf94b185.tar.gz postgresql-ac4a9d92fcb6869e757cc729dca2ca5ccf94b185.zip |
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>
Diffstat (limited to 'src/backend/executor/nodeWindowAgg.c')
-rw-r--r-- | src/backend/executor/nodeWindowAgg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 371548ceb39..96c8527eb32 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -2218,7 +2218,7 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, numArguments, 0, /* no ordered-set window functions yet */ false, /* no variadic window functions yet */ - wfunc->wintype, + aggtranstype, wfunc->inputcollid, transfn_oid, invtransfn_oid, |