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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix division by zero (explain.c)
Date: 2020-05-09 04:45:11
Message-ID: 16267.1588999511@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James Coleman <jtc331(at)gmail(dot)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;
+ }

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-05-09 04:59:30 Re: Back-branch minor release notes are up for review
Previous Message Peter Geoghegan 2020-05-09 04:21:25 Re: Should smgrdounlink() be removed?