88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.173 2005/03/16 21:38 :06 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.174 2005/03/22 20:13 :06 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -832,8 +832,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
832832if (!fcache -> setArgsValid )
833833{
834834/* Need to prep callinfo structure */
835- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
836- fcinfo .flinfo = & (fcache -> func );
835+ InitFunctionCallInfoData (fcinfo ,& (fcache -> func ),0 ,NULL ,NULL );
837836argDone = ExecEvalFuncArgs (& fcinfo ,arguments ,econtext );
838837if (argDone == ExprEndResult )
839838{
@@ -1046,9 +1045,6 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
10461045if (isDone )
10471046* isDone = ExprSingleResult ;
10481047
1049- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
1050- fcinfo .flinfo = & (fcache -> func );
1051-
10521048/* inlined, simplified version of ExecEvalFuncArgs */
10531049i = 0 ;
10541050foreach (arg ,fcache -> args )
@@ -1067,7 +1063,8 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
10671063errmsg ("set-valued function called in context that cannot accept a set" )));
10681064i ++ ;
10691065}
1070- fcinfo .nargs = i ;
1066+
1067+ InitFunctionCallInfoData (fcinfo ,& (fcache -> func ),i ,NULL ,NULL );
10711068
10721069/*
10731070 * If function is strict, and there are any NULL arguments, skip
@@ -1084,7 +1081,7 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
10841081}
10851082}
10861083}
1087- /* fcinfo.isnull = false; */ /* handled byMemSet */
1084+ /* fcinfo.isnull = false; */ /* handled byInitFunctionCallInfoData */
10881085result = FunctionCallInvoke (& fcinfo );
10891086* isNull = fcinfo .isnull ;
10901087
@@ -1132,8 +1129,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
11321129 * doesn't actually get to see the resultinfo, but set it up anyway
11331130 * because we use some of the fields as our own state variables.
11341131 */
1135- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
1136- fcinfo .resultinfo = (Node * )& rsinfo ;
1132+ InitFunctionCallInfoData (fcinfo ,NULL ,0 ,NULL , (Node * )& rsinfo );
11371133rsinfo .type = T_ReturnSetInfo ;
11381134rsinfo .econtext = econtext ;
11391135rsinfo .expectedDesc = expectedDesc ;
@@ -1499,8 +1495,7 @@ ExecEvalDistinct(FuncExprState *fcache,
14991495argList = fcache -> args ;
15001496
15011497/* Need to prep callinfo structure */
1502- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
1503- fcinfo .flinfo = & (fcache -> func );
1498+ InitFunctionCallInfoData (fcinfo ,& (fcache -> func ),0 ,NULL ,NULL );
15041499argDone = ExecEvalFuncArgs (& fcinfo ,argList ,econtext );
15051500if (argDone != ExprSingleResult )
15061501ereport (ERROR ,
@@ -1573,8 +1568,7 @@ ExecEvalScalarArrayOp(ScalarArrayOpExprState *sstate,
15731568}
15741569
15751570/* Need to prep callinfo structure */
1576- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
1577- fcinfo .flinfo = & (sstate -> fxprstate .func );
1571+ InitFunctionCallInfoData (fcinfo ,& (sstate -> fxprstate .func ),0 ,NULL ,NULL );
15781572argDone = ExecEvalFuncArgs (& fcinfo ,sstate -> fxprstate .args ,econtext );
15791573if (argDone != ExprSingleResult )
15801574ereport (ERROR ,
@@ -2287,8 +2281,7 @@ ExecEvalNullIf(FuncExprState *nullIfExpr,
22872281argList = nullIfExpr -> args ;
22882282
22892283/* Need to prep callinfo structure */
2290- MemSet (& fcinfo ,0 ,sizeof (fcinfo ));
2291- fcinfo .flinfo = & (nullIfExpr -> func );
2284+ InitFunctionCallInfoData (fcinfo ,& (nullIfExpr -> func ),0 ,NULL ,NULL );
22922285argDone = ExecEvalFuncArgs (& fcinfo ,argList ,econtext );
22932286if (argDone != ExprSingleResult )
22942287ereport (ERROR ,