1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Make number of args to a function configurable.

This commit is contained in:
Bruce Momjian
2000-01-10 17:14:46 +00:00
parent 6456b17bc1
commit 8a093d0ae3
30 changed files with 377 additions and 308 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.48 2000/01/10 16:13:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.49 2000/01/10 17:14:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -238,7 +238,6 @@ oidvectortypes(Oid *oidArray)
HeapTuple typetup;
text *result;
int num;
Oid *sp;
if (oidArray == NULL)
{
@@ -247,16 +246,16 @@ oidvectortypes(Oid *oidArray)
return result;
}
result = (text *) palloc(NAMEDATALEN * 8 + 8 + VARHDRSZ);
result = (text *) palloc(NAMEDATALEN * FUNC_MAX_ARGS +
FUNC_MAX_ARGS + VARHDRSZ);
*VARDATA(result) = '\0';
sp = oidArray;
for (num = 8; num != 0; num--, sp++)
for (num = 0; num < FUNC_MAX_ARGS; num++)
{
if (*sp != InvalidOid)
if (oidArray[num] != InvalidOid)
{
typetup = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(*sp),
ObjectIdGetDatum(oidArray[num]),
0, 0, 0);
if (HeapTupleIsValid(typetup))
{

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.45 2000/01/09 00:26:20 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.46 2000/01/10 17:14:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -253,7 +253,7 @@ intltsel(Oid opid,
rtype = ((Form_pg_operator) GETSTRUCT(oprtuple))->oprright;
/* Convert the constant to a uniform comparison scale. */
if (! convert_to_scale(value,
if (! convert_to_scale(value,
((flag & SEL_RIGHT) ? rtype : ltype),
&val))
{
@@ -310,7 +310,7 @@ intltsel(Oid opid,
* stats are out of date and return a default...
*/
*result = DEFAULT_INEQ_SEL;
}
}
else if (val <= low || val >= high)
{
/* If given value is outside the statistical range, return a
@@ -512,10 +512,10 @@ convert_to_scale(Datum value, Oid typid,
/* See whether there is a registered type-conversion function,
* namely a procedure named "float8" with the right signature.
*/
Oid oid_array[MAXFARGS];
Oid oid_array[FUNC_MAX_ARGS];
HeapTuple ftup;
MemSet(oid_array, 0, MAXFARGS * sizeof(Oid));
MemSet(oid_array, 0, FUNC_MAX_ARGS * sizeof(Oid));
oid_array[0] = typid;
ftup = SearchSysCacheTuple(PROCNAME,
PointerGetDatum("float8"),