aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r--src/backend/commands/functioncmds.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index eae2b09830b..ac401689c82 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -2216,13 +2216,13 @@ ExecuteDoStmt(DoStmt *stmt, bool atomic)
void
ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver *dest)
{
+ LOCAL_FCINFO(fcinfo, FUNC_MAX_ARGS);
ListCell *lc;
FuncExpr *fexpr;
int nargs;
int i;
AclResult aclresult;
FmgrInfo flinfo;
- FunctionCallInfoData fcinfo;
CallContext *callcontext;
EState *estate;
ExprContext *econtext;
@@ -2297,7 +2297,8 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
InvokeFunctionExecuteHook(fexpr->funcid);
fmgr_info(fexpr->funcid, &flinfo);
fmgr_info_set_expr((Node *) fexpr, &flinfo);
- InitFunctionCallInfoData(fcinfo, &flinfo, nargs, fexpr->inputcollid, (Node *) callcontext, NULL);
+ InitFunctionCallInfoData(*fcinfo, &flinfo, nargs, fexpr->inputcollid,
+ (Node *) callcontext, NULL);
/*
* Evaluate procedure arguments inside a suitable execution context. Note
@@ -2318,14 +2319,14 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
val = ExecEvalExprSwitchContext(exprstate, econtext, &isnull);
- fcinfo.arg[i] = val;
- fcinfo.argnull[i] = isnull;
+ fcinfo->args[i].value = val;
+ fcinfo->args[i].isnull = isnull;
i++;
}
- pgstat_init_function_usage(&fcinfo, &fcusage);
- retval = FunctionCallInvoke(&fcinfo);
+ pgstat_init_function_usage(fcinfo, &fcusage);
+ retval = FunctionCallInvoke(fcinfo);
pgstat_end_function_usage(&fcusage, true);
if (fexpr->funcresulttype == VOIDOID)
@@ -2346,7 +2347,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
TupOutputState *tstate;
TupleTableSlot *slot;
- if (fcinfo.isnull)
+ if (fcinfo->isnull)
elog(ERROR, "procedure returned null record");
td = DatumGetHeapTupleHeader(retval);