aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/executor/nodeAgg.c1
-rw-r--r--src/include/fmgr.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index eef0e8437de..bdc17a5a64b 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -1014,6 +1014,7 @@ finalize_partialaggregate(AggState *aggstate,
pergroupstate->transValueIsNull,
pertrans->transtypeLen);
fcinfo->args[0].isnull = pergroupstate->transValueIsNull;
+ fcinfo->isnull = false;
*resultVal = FunctionCallInvoke(fcinfo);
*resultIsNull = fcinfo->isnull;
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index 3ff099986b8..f61757373bc 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -163,6 +163,11 @@ extern void fmgr_symbol(Oid functionId, char **mod, char **fn);
* caller must still check fcinfo->isnull! Also, if function is strict,
* it is caller's responsibility to verify that no null arguments are present
* before calling.
+ *
+ * Some code performs multiple calls without redoing InitFunctionCallInfoData,
+ * possibly altering the argument values. This is okay, but be sure to reset
+ * the fcinfo->isnull flag before each call, since callees are permitted to
+ * assume that starts out false.
*/
#define FunctionCallInvoke(fcinfo) ((* (fcinfo)->flinfo->fn_addr) (fcinfo))