pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN varia
Date: Wed, 12 Nov 2025 23:48:46 +0000
Message-ID: <E1vJKZy-006JTK-0h@gemulon.postgresql.org> (raw)

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

pg_logical_slot_get_changes_guts() previously assigned InvalidXLogRecPtr to
the local variable upto_nchanges, which is of type int32, not XLogRecPtr.
While this caused no functional issue since InvalidXLogRecPtr is defined as 0,
it was semantically incorrect.

This commit fixes the issue by updating pg_logical_slot_get_changes_guts()
to set upto_nchanges to 0 instead of InvalidXLogRecPtr.

No backpatch is needed, as the previous behavior was harmless.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Steven Niu <niushiji@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHKHuR5NGnGxU3+ebz7cbC1ZAR=AgG4Bueq==Lj6iX8Sw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/705601c5aeab56aef62dd69ac2b7acf662f08e9c

Modified Files
--------------
src/backend/replication/logical/logicalfuncs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Message-ID: <E1vJKZy-006JTK-0h@gemulon.postgresql.org>
Permalink:  ../E1vJKZy-006JTK-0h@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vJKZy-006JTK-0h@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN varia
  In-Reply-To: <E1vJKZy-006JTK-0h@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox