aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 0fc4d7b59b2..92e43c1dc57 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.101 2006/03/05 15:58:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.102 2006/04/22 01:25:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -431,17 +431,19 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
{
int i;
- paramLI = (ParamListInfo) palloc0((nargs + 1) * sizeof(ParamListInfoData));
+ /* sizeof(ParamListInfoData) includes the first array element */
+ paramLI = (ParamListInfo) palloc(sizeof(ParamListInfoData) +
+ (nargs - 1) * sizeof(ParamExternData));
+ paramLI->numParams = nargs;
for (i = 0; i < nargs; i++)
{
- paramLI[i].kind = PARAM_NUM;
- paramLI[i].id = i + 1;
- paramLI[i].ptype = fcache->argtypes[i];
- paramLI[i].value = fcinfo->arg[i];
- paramLI[i].isnull = fcinfo->argnull[i];
+ ParamExternData *prm = &paramLI->params[i];
+
+ prm->value = fcinfo->arg[i];
+ prm->isnull = fcinfo->argnull[i];
+ prm->ptype = fcache->argtypes[i];
}
- paramLI[nargs].kind = PARAM_INVALID;
}
else
paramLI = NULL;