psort fixed

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: psort fixed
Date: 1998-02-01 22:41:45
Message-ID: 199802012241.RAA17263@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have fixed the regression test problem. The original psort() NULL
handling patch is attached. It made the while() into a for() which is
good, but he did not remove the increment at the bottom or the for(), so
nkey was being incremented twice in the loop. Fixed it, and now
regression looks good to me.

I have updated the files in tools/RELEASE_CHANGES to say 6.3, so I think
we are ready for some announcement on 6.3 beta, Marc. I recommend you
attach the HISTORY file for the release, so people know what is new.

---------------------------------------------------------------------------

Index: psort.c
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/backend/utils/sort/psort.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -c -r1.33 -r1.34
*** psort.c 1998/01/25 05:14:49 1.33
--- psort.c 1998/01/25 05:18:34 1.34
***************
*** 7,13 ****
*
*
* IDENTIFICATION
! * $Header: /usr/local/cvsroot/pgsql/src/backend/utils/sort/psort.c,v 1.33 1998/01/25 05:14:49 momjian Exp $
*
* NOTES
* Sorts the first relation into the second relation.
--- 7,13 ----
*
*
* IDENTIFICATION
! * $Header: /usr/local/cvsroot/pgsql/src/backend/utils/sort/psort.c,v 1.34 1998/01/25 05:18:34 scrappy Exp $
*
* NOTES
* Sorts the first relation into the second relation.
***************
*** 1094,1100 ****
int result = 0;
bool isnull1, isnull2;

! while ( nkey < PsortNkeys && !result )
{
lattr = heap_getattr(*ltup, InvalidBuffer,
PsortKeys[nkey].sk_attno,
--- 1094,1100 ----
int result = 0;
bool isnull1, isnull2;

! for (nkey = 0; nkey < PsortNkeys && !result; nkey++ )
{
lattr = heap_getattr(*ltup, InvalidBuffer,
PsortKeys[nkey].sk_attno,
***************
*** 1106,1119 ****
&isnull2);
if ( isnull1 )
{
! if ( isnull2 )
! return (0);
! return(1);
}
else if ( isnull2 )
! return (-1);

! if (PsortKeys[nkey].sk_flags & SK_COMMUTE)
{
if (!(result = -(long) (*fmgr_faddr(&PsortKeys[nkey].sk_func)) (rattr, lattr)))
result = (long) (*fmgr_faddr(&PsortKeys[nkey].sk_func)) (lattr, rattr);
--- 1106,1118 ----
&isnull2);
if ( isnull1 )
{
! if ( !isnull2 )
! result = 1;
}
else if ( isnull2 )
! result = -1;

! else if (PsortKeys[nkey].sk_flags & SK_COMMUTE)
{
if (!(result = -(long) (*fmgr_faddr(&PsortKeys[nkey].sk_func)) (rattr, lattr)))
result = (long) (*fmgr_faddr(&PsortKeys[nkey].sk_func)) (lattr, rattr);

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1998-02-01 23:29:59 Re: [PATCHES] Was the jdbc patch received?
Previous Message Bruce Momjian 1998-02-01 22:37:53 Re: [PATCHES] Was the jdbc patch received?