amcheck is using a wrong macro to check compressed-ness

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: amcheck is using a wrong macro to check compressed-ness
Date: 2022-05-17 07:27:19
Message-ID: 20220517.162719.1671558681467343711.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

While I looked into a patch, I noticed that check_tuple_attribute does
not run the check for compessed data even if a compressed data is
given.

check_tuple_attribute()
..
struct varatt_external toast_pointer;
..
VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr);
..
if (VARATT_IS_COMPRESSED(&toast_pointer))
{

Since toast_pointer is a varatt_exteral it should be
VARATT_EXTERNAL_IS_COMPRESSED instead. Since the just following
corss-check is just the reverse of what the macro does, it is useless.

What do you think about the attached? The problem code is new in
PG15.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Use-correct-macro-to-check-compressed-ness-in-amchec.patch text/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-05-17 07:52:11 Re: Fix a typo in walreceiver.c
Previous Message Noah Misch 2022-05-17 07:15:35 Re: has_wal_read_bug