The attached patches against 7.3 and 7.4 fix a subtraction carry bug in
xlog.c.

-- 
John Nield
jrnield@usol.com
20 Jun 2003 09:17:56 -0400
"J.R. Nield" <jrnield@usol.com>
Subtraction carry bug in xlog.c in 7.3 and 7.4
"J.R. Nield" <jrnield@usol.com> writes:
> The attached patches against 7.3 and 7.4 fix a subtraction carry bug in
> xlog.c.

This is simply a waste of cycles, because xrecoff can never be zero
(if it were, it'd be pointing at a page header, which is not a valid
record location).  If you look around in the code, you'll note that
xrecoff==0 is actually used as an invalid-value flag in a couple of
contexts.

Can you point to anyplace where the behavior would change?  If so
I think there's a deeper bug to fix.

			regards, tom lane

Fri, 20 Jun 2003 10:14:58 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Subtraction carry bug in xlog.c in 7.3 and 7.4 

Should we add an Assert() to make it clear the current code is OK?

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

Tom Lane wrote:
> "J.R. Nield" <jrnield@usol.com> writes:
> > The attached patches against 7.3 and 7.4 fix a subtraction carry bug in
> > xlog.c.
> 
> This is simply a waste of cycles, because xrecoff can never be zero
> (if it were, it'd be pointing at a page header, which is not a valid
> record location).  If you look around in the code, you'll note that
> xrecoff==0 is actually used as an invalid-value flag in a couple of
> contexts.
> 
> Can you point to anyplace where the behavior would change?  If so
> I think there's a deeper bug to fix.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 23 Jun 2003 23:31:01 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Subtraction carry bug in xlog.c in 7.3 and 7.4
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Should we add an Assert() to make it clear the current code is OK?

A comment maybe, but not an assert.

			regards, tom lane

Mon, 23 Jun 2003 23:51:49 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Subtraction carry bug in xlog.c in 7.3 and 7.4 