Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Michael Zhilin <m(dot)zhilin(at)postgrespro(dot)ru>, pgsql-bugs(at)postgresql(dot)org, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>
Subject: Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum
Date: 2024-03-20 16:00:00
Message-ID: e3a78e44-ec6c-5924-7832-63de3aad3e9b@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Alexander,

20.03.2024 13:24, Alexander Korotkov wrote:
> BTW, 0001 and 0002 look good to me. I'm going to push them if no objections.

Maybe these patches should be polished before committing:
+-- directory paths are passed to us in environment variables
looks like an irrelevant change (perhaps it was relevant in v1/v2, but
that's not so now.)

I'm also not sure about:
+-- BUG: must support different header size of short varlena datum
+-- https://postgr.es/m/7bdbe559-d61a-4ae4-a6e1-48abdf3024cc@postgrespro.ru

AFAICS, for most similar bug fixes, the bug report referenced in a commit
message only (there is no such comment in 0002, either). I also suspect
that the comment:
* Also tuple had short varlena datums with 4B header. ...
might looks incorrect for native English speakers.

This patch also adds a couple of empty lines, which may be not needed.
@@ -2973,6 +2973,7 @@ bt_normalize_tuple(BtreeCheckState *state, IndexTuple itup)
         * index without further processing, so an external varlena header
         * should never be encountered here
         */
> +
        if (VARATT_IS_EXTERNAL(DatumGetPointer(normalized[i])))
            ereport(ERROR,
                    (errcode(ERRCODE_INDEX_CORRUPTED),
---
        }
+       /*
...
+           need_free[i] = true;
+       }
> +
    }

Best regards,
Alexander

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Korotkov 2024-03-20 17:00:32 Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum
Previous Message Wolfgang Walther 2024-03-20 14:46:39 Re: Regression tests fail with musl libc because libpq.so can't be loaded