aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/functions.c15
-rw-r--r--src/backend/executor/spi.c17
2 files changed, 5 insertions, 27 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index c6b7203f813..965e5dea70e 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -906,21 +906,10 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
if (nargs > 0)
{
ParamListInfo paramLI;
- int i;
if (fcache->paramLI == NULL)
{
- paramLI = (ParamListInfo)
- palloc(offsetof(ParamListInfoData, params) +
- nargs * sizeof(ParamExternData));
- /* we have static list of params, so no hooks needed */
- paramLI->paramFetch = NULL;
- paramLI->paramFetchArg = NULL;
- paramLI->paramCompile = NULL;
- paramLI->paramCompileArg = NULL;
- paramLI->parserSetup = NULL;
- paramLI->parserSetupArg = NULL;
- paramLI->numParams = nargs;
+ paramLI = makeParamList(nargs);
fcache->paramLI = paramLI;
}
else
@@ -929,7 +918,7 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
Assert(paramLI->numParams == nargs);
}
- for (i = 0; i < nargs; i++)
+ for (int i = 0; i < nargs; i++)
{
ParamExternData *prm = &paramLI->params[i];
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 70c03e0f605..d898f4ca78d 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -2387,20 +2387,9 @@ _SPI_convert_params(int nargs, Oid *argtypes,
if (nargs > 0)
{
- int i;
-
- paramLI = (ParamListInfo) palloc(offsetof(ParamListInfoData, params) +
- nargs * sizeof(ParamExternData));
- /* we have static list of params, so no hooks needed */
- paramLI->paramFetch = NULL;
- paramLI->paramFetchArg = NULL;
- paramLI->paramCompile = NULL;
- paramLI->paramCompileArg = NULL;
- paramLI->parserSetup = NULL;
- paramLI->parserSetupArg = NULL;
- paramLI->numParams = nargs;
-
- for (i = 0; i < nargs; i++)
+ paramLI = makeParamList(nargs);
+
+ for (int i = 0; i < nargs; i++)
{
ParamExternData *prm = &paramLI->params[i];