Re: Wrong variable type in KeepLogSeg

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Wrong variable type in KeepLogSeg
Date: 2017-02-28 11:21:01
Message-ID: CABUevExG87_5PsnB9cdg+LEkEUMC2_Gm6d_twrTmUbSnsFX+0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 28, 2017 at 3:17 AM, Kyotaro HORIGUCHI <
horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

> Hello, I found a variable definition with wrong type
> specification in KeepLogSeg, which doesn't harm anything.
>
> > static void
> > KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
> > {
> > ...
> > /* then check whether slots limit removal further */
> > if (max_replication_slots > 0 && keep != InvalidXLogRecPtr)
> > {
> > XLogRecPtr slotSegNo;
> >
> > XLByteToSeg(keep, slotSegNo);
>
>
> slotSegNo should be a XLogSegNo. Both types share the same
> intrinsic type so it doesn't harm anything.
>
> This is back-patchable upto 9.4.
>

Nice catch. Applied and backpatched.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2017-02-28 11:34:29 Re: Should we cacheline align PGXACT?
Previous Message Magnus Hagander 2017-02-28 11:07:06 Re: rename pg_log directory?