mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +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:
@ -32,7 +32,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.65 2000/05/30 00:49:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.66 2000/05/30 04:24:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -327,12 +327,10 @@ finalize_aggregate(AggStatePerAgg peraggstate,
|
||||
continue;
|
||||
if (haveOldVal)
|
||||
{
|
||||
Datum equal;
|
||||
|
||||
equal = (Datum) (*fmgr_faddr(&peraggstate->equalfn)) (oldVal,
|
||||
newVal);
|
||||
if (DatumGetInt32(equal) != 0)
|
||||
if (DatumGetBool(FunctionCall2(&peraggstate->equalfn,
|
||||
oldVal, newVal)))
|
||||
{
|
||||
/* equal to prior, so forget this one */
|
||||
if (!peraggstate->inputtypeByVal)
|
||||
pfree(DatumGetPointer(newVal));
|
||||
continue;
|
||||
@ -780,13 +778,13 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
|
||||
typeidTypeName(aggref->basetype));
|
||||
aggform = (Form_pg_aggregate) GETSTRUCT(aggTuple);
|
||||
|
||||
peraggstate->initValue1 = (Datum)
|
||||
peraggstate->initValue1 =
|
||||
AggNameGetInitVal(aggname,
|
||||
aggform->aggbasetype,
|
||||
1,
|
||||
&peraggstate->initValue1IsNull);
|
||||
|
||||
peraggstate->initValue2 = (Datum)
|
||||
peraggstate->initValue2 =
|
||||
AggNameGetInitVal(aggname,
|
||||
aggform->aggbasetype,
|
||||
2,
|
||||
|
@ -15,7 +15,7 @@
|
||||
* locate group boundaries.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.35 2000/05/30 00:49:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.36 2000/05/30 04:24:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -430,7 +430,6 @@ execTuplesMatch(HeapTuple tuple1,
|
||||
attr2;
|
||||
bool isNull1,
|
||||
isNull2;
|
||||
Datum equal;
|
||||
|
||||
attr1 = heap_getattr(tuple1,
|
||||
att,
|
||||
@ -450,9 +449,8 @@ execTuplesMatch(HeapTuple tuple1,
|
||||
|
||||
/* Apply the type-specific equality function */
|
||||
|
||||
equal = (Datum) (*fmgr_faddr(&eqfunctions[i])) (attr1, attr2);
|
||||
|
||||
if (DatumGetInt32(equal) == 0)
|
||||
if (! DatumGetBool(FunctionCall2(&eqfunctions[i],
|
||||
attr1, attr2)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* spi.c
|
||||
* Server Programming Interface
|
||||
*
|
||||
* $Id: spi.c,v 1.45 2000/04/04 21:44:39 tgl Exp $
|
||||
* $Id: spi.c,v 1.46 2000/05/30 04:24:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -415,8 +415,10 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (fmgr(foutoid, val, typelem,
|
||||
tupdesc->attrs[fnumber - 1]->atttypmod));
|
||||
return DatumGetCString(OidFunctionCall3(foutoid,
|
||||
val,
|
||||
ObjectIdGetDatum(typelem),
|
||||
Int32GetDatum(tupdesc->attrs[fnumber - 1]->atttypmod)));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
Reference in New Issue
Block a user