Re: bogus assert in logicalmsg_desc

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: bogus assert in logicalmsg_desc
Date: 2022-08-15 01:20:28
Message-ID: CAMbWs489R=QhjhaJLdR2R31UHKox9iviHHQ+ki60cetVjjERkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 15, 2022 at 12:17 AM Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-08-15 01:48:22 Re: Cleaning up historical portability baggage
Previous Message Masahiko Sawada 2022-08-15 01:13:35 Re: bogus assert in logicalmsg_desc