Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Дата
Msg-id 45ba068b-66ea-b74c-5a92-6c2127d63e28@eisentraut.org
обсуждение исходный текст
Ответ на Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 27.09.23 09:08, Michael Paquier wrote:
> On Wed, Sep 27, 2023 at 08:41:55AM +0200, Jakub Wartak wrote:
>> Attached patch adjusts pgstat_track_activity_query_size to be of
>> size_t from int and fixes the issue.
> 
> This cannot be backpatched, and using size_t is not really needed as
> track_activity_query_size is capped at 1MB.  Why don't you just tweak
> the calculation done in pgstat_read_current_status() instead, say with
> a cast?

I think it's preferable to use the right type to begin with, rather than 
fixing it up afterwards with casts.




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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Is this a problem in GenericXLogFinish()?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Is this a problem in GenericXLogFinish()?