Re: [HACKERS] min() and max() causing aborts - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] min() and max() causing aborts
Date
Msg-id 199903211858.NAA28452@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] min() and max() causing aborts  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] min() and max() causing aborts
List pgsql-hackers
> Yesterday evening (after you partially backed out that patch) I updated
> and rebuilt and ran regression test.  I didn't see any regress failures
> involving aggregates, and a quick hand smoke-test of max and min looks
> OK:

I am attaching the patch I BACKED HOW, so the user can see if it is in
their tree.  It should not be ther.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
***
/afs/ece.cmu.edu/project/lcs/lcs-004/er1p/postgres/611/src/backend/executor/nodeAgg.c
Thu Mar 11 23:59:11 1999
---
/afs/ece.cmu.edu/project/lcs/lcs-004/er1p/postgres/612/src/backend/executor/nodeAgg.c
Fri Mar 19 15:01:21 1999
***************
*** 110,115 ****
--- 110,116 ----
                  isNull2 = FALSE;
      bool        qual_result;

+     Datum  oldVal = (Datum) NULL;  /* XXX - so that we can save and free on each iteration - er1p */

      /* ---------------------
       *    get state info from node
***************
*** 372,379 ****
--- 373,382 ----
                           */
                          args[0] = value1[aggno];
                          args[1] = newVal;
+                         oldVal = value1[aggno]; /* XXX - save so we can free later - er1p */
                          value1[aggno] =    (Datum) fmgr_c(&aggfns->xfn1,
                                             (FmgrValues *) args, &isNull1);
+                         pfree(oldVal); /* XXX - new, let's free the old datum - er1p */
                          Assert(!isNull1);
                      }
                  }

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] min() and max() causing aborts
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Unary % operator is broken in current sources