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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Дата
Msg-id ZRPi9xOBFoTJ5rTb@paquier.xyz
обсуждение исходный текст
Ответ на pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Jakub Wartak <jakub.wartak@enterprisedb.com>)
Ответы Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Jakub Wartak <jakub.wartak@enterprisedb.com>)
Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
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?
--
Michael

Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: make add_paths_to_append_rel aware of startup cost
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: logfmt and application_context