Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable. - Mailing list pgsql-hackers

From Fujii Masao
Subject Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.
Date
Msg-id CAHGQGwHKHuR5NGnGxU3+ebz7cbC1ZAR=AgG4Bueq==Lj6iX8Sw@mail.gmail.com
Whole thread Raw
Responses Re: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.
Re: Fix incorrect assignment of InvalidXLogRecPtr to a non-LSN variable.
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: Trying out read streams in pgvector (an extension)
Next
From: Ajin Cherian
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance