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

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: [PATCH] Fix division by zero (explain.c)
Дата
Msg-id CAEudQAp+7qoS92-4V1vLChpdY3vEkLCbf+gye6P-4cirE-0z0A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Fix division by zero (explain.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] Fix division by zero (explain.c)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
Em sáb., 9 de mai. de 2020 às 01:45, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
James Coleman <jtc331@gmail.com> writes:
> There are always full sort groups before any prefix groups can happen,
> so we know (even though the tooling doesn't) that the 2nd test can
> never contradict the first.

So maybe an assertion enforcing that would be appropriate?
Untested, but:

-                       if (fullsortGroupInfo->groupCount == 0 &&
-                               prefixsortGroupInfo->groupCount == 0)
+                       if (fullsortGroupInfo->groupCount == 0)
+                       {
+                               Assert(prefixsortGroupInfo->groupCount == 0);
                                continue;
+                       }
I agree, asserts always help.

regards,
Ranier Vilela
Вложения

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

Предыдущее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: stat() on Windows might cause error if target file is larger than 4GB
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: PG 13 release notes, first draft