amcheck is using a wrong macro to check compressed-ness

Kyotaro Horiguchi <horikyota.ntt@gmail.com>

From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-05-17T07:27:19Z
Lists: pgsql-hackers

Attachments

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

Commits

  1. amcheck: Fix incorrect use of VARATT_IS_COMPRESSED.