aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAgg.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-05-30 04:25:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-05-30 04:25:00 +0000
commit0f1e39643de655f5103b09d5a82cadbf26a965c1 (patch)
tree32fa30338e5065afbc28df7dae4c2d2a0bce1569 /src/backend/executor/nodeAgg.c
parenta12a23f0d03cc8bf22c6c38bc2394753ec34fcdf (diff)
downloadpostgresql-0f1e39643de655f5103b09d5a82cadbf26a965c1.tar.gz
postgresql-0f1e39643de655f5103b09d5a82cadbf26a965c1.zip
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 ...
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r--src/backend/executor/nodeAgg.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 61bfb3c6d31..1999acedc12 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -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,