benign bug in BufFileLoadBuffer / incorrect sizeof

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: benign bug in BufFileLoadBuffer / incorrect sizeof
Date: 2025-01-12 16:10:19
Message-ID: 928bdab1-6567-449f-98c4-339cd2203b87@vondra.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While experimenting with some changes in BufFile, I noticed a harmless
bug in BufFileLoadBuffer. It calls sizeof on the whole PGAlignedBuffer,
instead of just on the "data" field. It's benign because the "data" is
the largest part of the union, so the sizes are equal.

But it's still confusing, it took me a while my experimental patch
fails. So I think it'd be good to correct it.

regards

--
Tomas Vondra

Attachment Content-Type Size
buffile-sizeof-fix.patch text/x-patch 475 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michail Nikolaev 2025-01-12 16:40:09 Re: Strange assertion in procarray.c
Previous Message Dean Rasheed 2025-01-12 14:10:29 Re: Missing quotes when deparsing XMLTABLE() and SQL/JSON query functions