1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Third round of fmgr updates: eliminate calls using fmgr() and

fmgr_faddr() in favor of new-style calls.  Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...
This commit is contained in:
Tom Lane
2000-05-30 04:25:00 +00:00
parent a12a23f0d0
commit 0f1e39643d
35 changed files with 570 additions and 443 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.112 2000/05/30 00:49:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.113 2000/05/30 04:24:35 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -1922,16 +1922,16 @@ index_build(Relation heapRelation,
* ----------------
*/
if (RegProcedureIsValid(procedure))
fmgr(procedure,
heapRelation,
indexRelation,
numberOfAttributes,
attributeNumber,
RelationGetIndexStrategy(indexRelation),
parameterCount,
parameter,
funcInfo,
predInfo);
OidFunctionCall9(procedure,
PointerGetDatum(heapRelation),
PointerGetDatum(indexRelation),
Int32GetDatum(numberOfAttributes),
PointerGetDatum(attributeNumber),
PointerGetDatum(RelationGetIndexStrategy(indexRelation)),
UInt16GetDatum(parameterCount),
PointerGetDatum(parameter),
PointerGetDatum(funcInfo),
PointerGetDatum(predInfo));
else
DefaultBuild(heapRelation,
indexRelation,

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.32 2000/04/16 04:16:09 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.33 2000/05/30 04:24:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -268,7 +268,7 @@ AggregateCreate(char *aggName,
heap_close(aggdesc, RowExclusiveLock);
}
char *
Datum
AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
{
HeapTuple tup;
@@ -278,8 +278,8 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
typinput,
typelem;
text *textInitVal;
char *strInitVal,
*initVal;
char *strInitVal;
Datum initVal;
Assert(PointerIsValid(aggName));
Assert(PointerIsValid(isNull));
@@ -320,7 +320,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
if (*isNull)
{
heap_close(aggRel, AccessShareLock);
return (char *) NULL;
return PointerGetDatum(NULL);
}
strInitVal = textout(textInitVal);
@@ -337,7 +337,10 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
typinput = ((Form_pg_type) GETSTRUCT(tup))->typinput;
typelem = ((Form_pg_type) GETSTRUCT(tup))->typelem;
initVal = fmgr(typinput, strInitVal, typelem, -1);
initVal = OidFunctionCall3(typinput,
CStringGetDatum(strInitVal),
ObjectIdGetDatum(typelem),
Int32GetDatum(-1));
pfree(strInitVal);
return initVal;