diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-29 03:01:32 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-29 03:01:32 +0000 |
commit | 8c85a34a3b945059e1bc03e2f0988b8092a365fd (patch) | |
tree | b785abb23ba5b4a353a4aad3767cde784c19fbe9 /src/backend/utils | |
parent | 4f6f5db47484c6550cfe792e80fc2c824154995e (diff) | |
download | postgresql-8c85a34a3b945059e1bc03e2f0988b8092a365fd.tar.gz postgresql-8c85a34a3b945059e1bc03e2f0988b8092a365fd.zip |
Officially decouple FUNC_MAX_ARGS from INDEX_MAX_KEYS, and set the
former to 100 by default. Clean up some of the less necessary
dependencies on FUNC_MAX_ARGS; however, the biggie (FunctionCallInfoData)
remains.
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/adt/arrayfuncs.c | 28 | ||||
-rw-r--r-- | src/backend/utils/fmgr/fmgr.c | 10 |
2 files changed, 20 insertions, 18 deletions
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 47edcc5a573..ec21eac9c03 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.118 2005/03/29 00:17:08 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.119 2005/03/29 03:01:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2577,9 +2577,8 @@ array_eq(PG_FUNCTION_ARGS) /* * apply the operator to each pair of array elements. */ - MemSet(&locfcinfo, 0, sizeof(locfcinfo)); - locfcinfo.flinfo = &typentry->eq_opr_finfo; - locfcinfo.nargs = 2; + InitFunctionCallInfoData(locfcinfo, &typentry->eq_opr_finfo, 2, + NULL, NULL); /* Loop over source data */ for (i = 0; i < nitems1; i++) @@ -2727,9 +2726,8 @@ array_cmp(FunctionCallInfo fcinfo) /* * apply the operator to each pair of array elements. */ - MemSet(&locfcinfo, 0, sizeof(locfcinfo)); - locfcinfo.flinfo = &typentry->cmp_proc_finfo; - locfcinfo.nargs = 2; + InitFunctionCallInfoData(locfcinfo, &typentry->cmp_proc_finfo, 2, + NULL, NULL); /* Loop over source data */ min_nitems = Min(nitems1, nitems2); @@ -3172,12 +3170,14 @@ array_type_length_coerce_internal(ArrayType *src, * We pass on the desttypmod and isExplicit flags whether or not the * function wants them. */ - MemSet(&locfcinfo, 0, sizeof(locfcinfo)); - locfcinfo.flinfo = &my_extra->coerce_finfo; - locfcinfo.nargs = 3; + InitFunctionCallInfoData(locfcinfo, &my_extra->coerce_finfo, 3, + NULL, NULL); locfcinfo.arg[0] = PointerGetDatum(src); locfcinfo.arg[1] = Int32GetDatum(desttypmod); locfcinfo.arg[2] = BoolGetDatum(isExplicit); + locfcinfo.argnull[0] = false; + locfcinfo.argnull[1] = false; + locfcinfo.argnull[2] = false; return array_map(&locfcinfo, my_extra->srctype, my_extra->desttype, &my_extra->amstate); @@ -3246,12 +3246,14 @@ array_length_coerce(PG_FUNCTION_ARGS) * * Note: we pass isExplicit whether or not the function wants it ... */ - MemSet(&locfcinfo, 0, sizeof(locfcinfo)); - locfcinfo.flinfo = &my_extra->coerce_finfo; - locfcinfo.nargs = 3; + InitFunctionCallInfoData(locfcinfo, &my_extra->coerce_finfo, 3, + NULL, NULL); locfcinfo.arg[0] = PointerGetDatum(v); locfcinfo.arg[1] = Int32GetDatum(desttypmod); locfcinfo.arg[2] = BoolGetDatum(isExplicit); + locfcinfo.argnull[0] = false; + locfcinfo.argnull[1] = false; + locfcinfo.argnull[2] = false; return array_map(&locfcinfo, ARR_ELEMTYPE(v), ARR_ELEMTYPE(v), &my_extra->amstate); diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index 430cfeffc70..a8bb5fc0ac5 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.91 2005/03/29 00:17:15 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.92 2005/03/29 03:01:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -337,9 +337,9 @@ fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple) /* Old style: need to use a handler */ finfo->fn_addr = fmgr_oldstyle; fnextra = (Oldstyle_fnextra *) - MemoryContextAlloc(finfo->fn_mcxt, sizeof(Oldstyle_fnextra)); + MemoryContextAllocZero(finfo->fn_mcxt, + sizeof(Oldstyle_fnextra)); finfo->fn_extra = (void *) fnextra; - MemSet(fnextra, 0, sizeof(Oldstyle_fnextra)); fnextra->func = (func_ptr) user_fn; for (i = 0; i < procedureStruct->pronargs; i++) { @@ -795,8 +795,8 @@ fmgr_security_definer(PG_FUNCTION_ARGS) if (!fcinfo->flinfo->fn_extra) { - fcache = MemoryContextAlloc(fcinfo->flinfo->fn_mcxt, sizeof(*fcache)); - memset(fcache, 0, sizeof(*fcache)); + fcache = MemoryContextAllocZero(fcinfo->flinfo->fn_mcxt, + sizeof(*fcache)); fmgr_info_cxt_security(fcinfo->flinfo->fn_oid, &fcache->flinfo, fcinfo->flinfo->fn_mcxt, true); |