8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -832,8 +832,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
832
832
if (!fcache -> setArgsValid )
833
833
{
834
834
/* Need to prep callinfo structure */
835
- MemSet (& fcinfo , 0 , sizeof (fcinfo ));
836
- fcinfo .flinfo = & (fcache -> func );
835
+ InitFunctionCallInfoData (fcinfo , & (fcache -> func ), 0 , NULL , NULL );
837
836
argDone = ExecEvalFuncArgs (& fcinfo , arguments , econtext );
838
837
if (argDone == ExprEndResult )
839
838
{
@@ -1046,9 +1045,6 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
1046
1045
if (isDone )
1047
1046
* isDone = ExprSingleResult ;
1048
1047
1049
- MemSet (& fcinfo , 0 , sizeof (fcinfo ));
1050
- fcinfo .flinfo = & (fcache -> func );
1051
-
1052
1048
/* inlined, simplified version of ExecEvalFuncArgs */
1053
1049
i = 0 ;
1054
1050
foreach (arg , fcache -> args )
@@ -1067,7 +1063,8 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
1067
1063
errmsg ("set-valued function called in context that cannot accept a set" )));
1068
1064
i ++ ;
1069
1065
}
1070
- fcinfo .nargs = i ;
1066
+
1067
+ InitFunctionCallInfoData (fcinfo , & (fcache -> func ), i , NULL , NULL );
1071
1068
1072
1069
/*
1073
1070
* If function is strict, and there are any NULL arguments, skip
@@ -1084,7 +1081,7 @@ ExecMakeFunctionResultNoSets(FuncExprState *fcache,
1084
1081
}
1085
1082
}
1086
1083
}
1087
- /* fcinfo.isnull = false; */ /* handled by MemSet */
1084
+ /* fcinfo.isnull = false; */ /* handled by InitFunctionCallInfoData */
1088
1085
result = FunctionCallInvoke (& fcinfo );
1089
1086
* isNull = fcinfo .isnull ;
1090
1087
@@ -1132,8 +1129,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
1132
1129
* doesn't actually get to see the resultinfo, but set it up anyway
1133
1130
* because we use some of the fields as our own state variables.
1134
1131
*/
1135
- MemSet (& fcinfo , 0 , sizeof (fcinfo ));
1136
- fcinfo .resultinfo = (Node * ) & rsinfo ;
1132
+ InitFunctionCallInfoData (fcinfo , NULL , 0 , NULL , (Node * ) & rsinfo );
1137
1133
rsinfo .type = T_ReturnSetInfo ;
1138
1134
rsinfo .econtext = econtext ;
1139
1135
rsinfo .expectedDesc = expectedDesc ;
@@ -1499,8 +1495,7 @@ ExecEvalDistinct(FuncExprState *fcache,
1499
1495
argList = fcache -> args ;
1500
1496
1501
1497
/* Need to prep callinfo structure */
1502
- MemSet (& fcinfo , 0 , sizeof (fcinfo ));
1503
- fcinfo .flinfo = & (fcache -> func );
1498
+ InitFunctionCallInfoData (fcinfo , & (fcache -> func ), 0 , NULL , NULL );
1504
1499
argDone = ExecEvalFuncArgs (& fcinfo , argList , econtext );
1505
1500
if (argDone != ExprSingleResult )
1506
1501
ereport (ERROR ,
@@ -1573,8 +1568,7 @@ ExecEvalScalarArrayOp(ScalarArrayOpExprState *sstate,
1573
1568
}
1574
1569
1575
1570
/* 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 );
1578
1572
argDone = ExecEvalFuncArgs (& fcinfo , sstate -> fxprstate .args , econtext );
1579
1573
if (argDone != ExprSingleResult )
1580
1574
ereport (ERROR ,
@@ -2287,8 +2281,7 @@ ExecEvalNullIf(FuncExprState *nullIfExpr,
2287
2281
argList = nullIfExpr -> args ;
2288
2282
2289
2283
/* Need to prep callinfo structure */
2290
- MemSet (& fcinfo , 0 , sizeof (fcinfo ));
2291
- fcinfo .flinfo = & (nullIfExpr -> func );
2284
+ InitFunctionCallInfoData (fcinfo , & (nullIfExpr -> func ), 0 , NULL , NULL );
2292
2285
argDone = ExecEvalFuncArgs (& fcinfo , argList , econtext );
2293
2286
if (argDone != ExprSingleResult )
2294
2287
ereport (ERROR ,
0 commit comments