Re: Consistently use the XLogRecPtrIsInvalid() macro

Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Peter Eisentraut <peter@eisentraut.org>, Michael Paquier <michael@paquier.xyz>, Heikki Linnakangas <hlinnaka@iki.fi>, Quan Zongliang <quanzongliang@yeah.net>, pgsql-hackers@lists.postgresql.org
Date: 2025-11-17T13:12:24Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Replace literal 0 with InvalidXLogRecPtr for XLogRecPtr assignments

  2. Replace pointer comparisons and assignments to literal zero with NULL

  3. Use XLogRecPtrIsValid() in various places

  4. Introduce XLogRecPtrIsValid()

Attachments

Hi,

On Thu, Nov 13, 2025 at 02:11:08PM +0000, Bertrand Drouvot wrote:
> On Fri, Nov 07, 2025 at 02:37:32PM +0100, Álvaro Herrera wrote:
> 
> I guess/hope you'll get the same results if you use run_parallel.sh as mentioned
> above.

The .cocci script had an issue (not always detecting correctly direct member
access).

The script has been updated and the patch too (finding a new replacement in
gist.c).

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com