Обсуждение: Use correct macro for accessing offset numbers.

Поиск
Список
Период
Сортировка

Use correct macro for accessing offset numbers.

От
Kirill Reshke
Дата:
Hi hackers!

While working on pageinspect support for GIN and SpGiST (welcome to
review them [0] & [1]), I spotted $subi.

PFA trivial patch that uses UInt16GetDatum for OffsetNumber rather
than Int16GetDatum


[0]https://www.postgresql.org/message-id/CALdSSPiN13n7feQcY0WCmq8jzxjwqhNrt1E%3Dg%3Dg6aZANyE_OoQ%40mail.gmail.com
[1] https://www.postgresql.org/message-id/CALdSSPhbAQbFtjK0nT8_G5GsXmsSEVx8J735Ga%2BZxLp9osHcRA%40mail.gmail.com

-- 
Best regards,
Kirill Reshke

Вложения

Re: Use correct macro for accessing offset numbers.

От
Roman Khapov
Дата:
> On 11 Jan 2026, at 16:21, Kirill Reshke <reshkekirill@gmail.com> wrote:
> 
> Hi hackers!
> 
> PFA trivial patch that uses UInt16GetDatum for OffsetNumber rather
> than Int16GetDatum

Hi!

LGTM, should we check another places of offset number conversations to Datum
as part of this thread?

--
Best regards,
Roman Khapov



Re: Use correct macro for accessing offset numbers.

От
Kirill Reshke
Дата:
On Sun, 11 Jan 2026 at 16:41, Roman Khapov <rkhapov@yandex-team.ru> wrote:
>
> should we check another places of offset number conversations to Datum
> as part of this thread?

Maybe, I have stopped some more cases, in v2-0001


-- 
Best regards,
Kirill Reshke

Вложения

Re: Use correct macro for accessing offset numbers.

От
Michael Paquier
Дата:
On Sun, Jan 11, 2026 at 04:58:39PM +0500, Kirill Reshke wrote:
> Maybe, I have stopped some more cases, in v2-0001

Right.  It's true that we could be more consistent for all these based
on their base type, some of them, particularly in the GIN code now,
caring about using the correct macro.  It may be a good occasion to
double-check the whole tree for similar holes based on unsigned types.
--
Michael

Вложения