Re: [PATCH] Fix division by zero (explain.c)

Поиск
Список
Период
Сортировка
От James Coleman
Тема Re: [PATCH] Fix division by zero (explain.c)
Дата
Msg-id CAAaqYe-45WH4Shfxb-xtwEq=dVa-Tycwif+bpDK_cuu6O-ZM2Q@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Fix division by zero (explain.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: [PATCH] Fix division by zero (explain.c)
Список pgsql-hackers
On Thu, Apr 23, 2020 at 8:38 AM Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Hi,
>
> Per Coverity.
>
> If has 0 full groups, "we don't need to do anything" and need goes to next.
> Otherwise a integer division by zero, can raise.
>
> comments extracted trom explain.c:
>  /*
> * Since we never have any prefix groups unless we've first sorted
> * a full groups and transitioned modes (copying the tuples into a
> * prefix group), we don't need to do anything if there were 0 full
> * groups.
> */

This does look like a fairly obvious thinko on my part, and the patch
looks correct to me.

Tomas: agreed?

Thanks,
James



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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Re: [PATCH] Fix possible overflow on tuplesort.c
Следующее
От: Andres Freund
Дата:
Сообщение: Re: backup manifests