Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-12T08:23:13Z
Lists: pgsql-hackers

Attachments

Hi,

I noticed that pg_logical_slot_get_changes_guts() assigns InvalidXLogRecPtr
to the local variable upto_nchanges, even though it's not LSN variable
(i.e., its type is int32, not XLogRecPtr). While this causes no functional issue
since InvalidXLogRecPtr is defined as 0, it's semantically incorrect.

I propose fixing this by setting upto_nchanges to 0 instead of
InvalidXLogRecPtr.
Attached is a patch implementing this change.

Regards,

-- 
Fujii Masao

Commits

  1. Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.