Re: Improper use about DatumGetInt32

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Improper use about DatumGetInt32
Дата
Msg-id 20201126132712.GA4301@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Improper use about DatumGetInt32  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Improper use about DatumGetInt32
Список pgsql-hackers
On 2020-Nov-26, Peter Eisentraut wrote:

> The point of the patch is to have the range check somewhere.  If you just
> cast it, then you won't notice out of range arguments.  Note that other
> contrib modules that take block numbers work the same way.

I'm not saying not to do that; just saying we should not propagate it to
places that don't need it.  get_raw_page gets its page number from
PG_GETARG_INT64(), and the range check should be there.  But then it
calls get_raw_page_internal, and it could pass a BlockNumber -- there's
no need to pass an int64.  So get_raw_page_internal does not need a
range check.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniil Zakhlystov
Дата:
Сообщение: Re: libpq compression
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Allow some recovery parameters to be changed with reload