Re: bogus assert in logicalmsg_desc - Mailing list pgsql-hackers

From Richard Guo
Subject Re: bogus assert in logicalmsg_desc
Date
Msg-id CAMbWs489R=QhjhaJLdR2R31UHKox9iviHHQ+ki60cetVjjERkg@mail.gmail.com
Whole thread Raw
In response to bogus assert in logicalmsg_desc  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers

On Mon, Aug 15, 2022 at 12:17 AM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote:
So prefix_size includes the null byte, so the assert points out at the
first payload byte. And of course, the check should be "==" because we
expect the byte to be \0, not the other way around.

Yes, indeed. There is even a comment emphasizing the trailing null byte
in LogLogicalMessage.

    /* trailing zero is critical; see logicalmsg_desc */

 

Attached is a patch addressing this. This was added in 14, so we should
backpatch to that version.

+1 for the patch.

Thanks
Richard 

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: bogus assert in logicalmsg_desc
Next
From: Thomas Munro
Date:
Subject: Re: Cleaning up historical portability baggage