aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execQual.c25
-rw-r--r--src/backend/executor/nodeAgg.c21
2 files changed, 14 insertions, 32 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 3613d31a056..63a734ea0f0 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.173 2005/03/16 21:38:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.174 2005/03/22 20:13:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -832,8 +832,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
if (!fcache->setArgsValid)
{
/* Need to prep callinfo structure */
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.flinfo = &(fcache->func);
+ InitFunctionCallInfoData(fcinfo, &(fcache->func), 0, NULL, NULL);
argDone = ExecEvalFuncArgs(&fcinfo, arguments, econtext);
if (argDone == ExprEndResult)
{
@@ -1046,9 +1045,6 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
if (isDone)
*isDone = ExprSingleResult;
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.flinfo = &(fcache->func);
-
/* inlined, simplified version of ExecEvalFuncArgs */
i = 0;
foreach(arg, fcache->args)
@@ -1067,7 +1063,8 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
errmsg("set-valued function called in context that cannot accept a set")));
i++;
}
- fcinfo.nargs = i;
+
+ InitFunctionCallInfoData(fcinfo, &(fcache->func), i, NULL, NULL);
/*
* If function is strict, and there are any NULL arguments, skip
@@ -1084,7 +1081,7 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
}
}
}
- /* fcinfo.isnull = false; */ /* handled by MemSet */
+ /* fcinfo.isnull = false; */ /* handled by InitFunctionCallInfoData */
result = FunctionCallInvoke(&fcinfo);
*isNull = fcinfo.isnull;
@@ -1132,8 +1129,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
* doesn't actually get to see the resultinfo, but set it up anyway
* because we use some of the fields as our own state variables.
*/
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.resultinfo = (Node *) &rsinfo;
+ InitFunctionCallInfoData(fcinfo, NULL, 0, NULL, (Node *) &rsinfo);
rsinfo.type = T_ReturnSetInfo;
rsinfo.econtext = econtext;
rsinfo.expectedDesc = expectedDesc;
@@ -1499,8 +1495,7 @@ ExecEvalDistinct(FuncExprState *fcache,
argList = fcache->args;
/* Need to prep callinfo structure */
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.flinfo = &(fcache->func);
+ InitFunctionCallInfoData(fcinfo, &(fcache->func), 0, NULL, NULL);
argDone = ExecEvalFuncArgs(&fcinfo, argList, econtext);
if (argDone != ExprSingleResult)
ereport(ERROR,
@@ -1573,8 +1568,7 @@ ExecEvalScalarArrayOp(ScalarArrayOpExprState *sstate,
}
/* Need to prep callinfo structure */
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.flinfo = &(sstate->fxprstate.func);
+ InitFunctionCallInfoData(fcinfo, &(sstate->fxprstate.func), 0, NULL, NULL);
argDone = ExecEvalFuncArgs(&fcinfo, sstate->fxprstate.args, econtext);
if (argDone != ExprSingleResult)
ereport(ERROR,
@@ -2287,8 +2281,7 @@ ExecEvalNullIf(FuncExprState *nullIfExpr,
argList = nullIfExpr->args;
/* Need to prep callinfo structure */
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.flinfo = &(nullIfExpr->func);
+ InitFunctionCallInfoData(fcinfo, &(nullIfExpr->func), 0, NULL, NULL);
argDone = ExecEvalFuncArgs(&fcinfo, argList, econtext);
if (argDone != ExprSingleResult)
ereport(ERROR,
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 1e211803df1..1756f35e7b6 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -61,7 +61,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.130 2005/03/16 21:38:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.131 2005/03/22 20:13:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -373,18 +373,9 @@ advance_transition_function(AggState *aggstate,
/*
* OK to call the transition function
- *
- * This is heavily-used code, so manually zero just the necessary fields
- * instead of using MemSet(). Compare FunctionCall2().
*/
-
- /* MemSet(&fcinfo, 0, sizeof(fcinfo)); */
- fcinfo.context = (void *) aggstate;
- fcinfo.resultinfo = NULL;
- fcinfo.isnull = false;
-
- fcinfo.flinfo = &peraggstate->transfn;
- fcinfo.nargs = 2;
+ InitFunctionCallInfoData(fcinfo, &(peraggstate->transfn), 2,
+ (void *) aggstate, NULL);
fcinfo.arg[0] = pergroupstate->transValue;
fcinfo.argnull[0] = pergroupstate->transValueIsNull;
fcinfo.arg[1] = newVal;
@@ -556,10 +547,8 @@ finalize_aggregate(AggState *aggstate,
{
FunctionCallInfoData fcinfo;
- MemSet(&fcinfo, 0, sizeof(fcinfo));
- fcinfo.context = (void *) aggstate;
- fcinfo.flinfo = &peraggstate->finalfn;
- fcinfo.nargs = 1;
+ InitFunctionCallInfoData(fcinfo, &(peraggstate->finalfn), 1,
+ (void *) aggstate, NULL);
fcinfo.arg[0] = pergroupstate->transValue;
fcinfo.argnull[0] = pergroupstate->transValueIsNull;
if (fcinfo.flinfo->fn_strict && pergroupstate->transValueIsNull)