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

2020-05-09 Thread Ranier Vilela
Em sáb., 9 de mai. de 2020 às 17:48, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: > On Sat, May 09, 2020 at 02:51:50PM -0300, Ranier Vilela wrote: > >Em sáb., 9 de mai. de 2020 às 14:44, Tomas Vondra < > >tomas.von...@2ndquadrant.com> escreveu: > > > >> On Sat, May 09, 2020 at

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

2020-05-09 Thread Tomas Vondra
On Sat, May 09, 2020 at 02:51:50PM -0300, Ranier Vilela wrote: Em sáb., 9 de mai. de 2020 às 14:44, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: On Sat, May 09, 2020 at 06:48:59AM -0300, Ranier Vilela wrote: >Em sáb., 9 de mai. de 2020 às 01:45, Tom Lane escreveu: > >> James Coleman

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

2020-05-09 Thread Ranier Vilela
Em sáb., 9 de mai. de 2020 às 14:44, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: > On Sat, May 09, 2020 at 06:48:59AM -0300, Ranier Vilela wrote: > >Em sáb., 9 de mai. de 2020 às 01:45, Tom Lane > escreveu: > > > >> James Coleman writes: > >> > There are always full sort groups

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

2020-05-09 Thread Tomas Vondra
On Sat, May 09, 2020 at 06:48:59AM -0300, Ranier Vilela wrote: Em sáb., 9 de mai. de 2020 às 01:45, Tom Lane escreveu: James Coleman 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

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

2020-05-09 Thread Ranier Vilela
Em sáb., 9 de mai. de 2020 às 01:45, Tom Lane escreveu: > James Coleman 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

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

2020-05-08 Thread Tom Lane
James Coleman 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

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

2020-05-08 Thread Tomas Vondra
On Fri, May 08, 2020 at 07:33:03PM -0400, James Coleman wrote: On Fri, May 8, 2020 at 7:20 PM Tomas Vondra wrote: On Fri, May 08, 2020 at 07:25:36PM -0300, Ranier Vilela wrote: >Em sex., 8 de mai. de 2020 às 19:02, Tomas Vondra < >tomas.von...@2ndquadrant.com> escreveu: > >> On Thu, Apr 23,

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

2020-05-08 Thread James Coleman
On Fri, May 8, 2020 at 7:20 PM Tomas Vondra wrote: > > On Fri, May 08, 2020 at 07:25:36PM -0300, Ranier Vilela wrote: > >Em sex., 8 de mai. de 2020 às 19:02, Tomas Vondra < > >tomas.von...@2ndquadrant.com> escreveu: > > > >> On Thu, Apr 23, 2020 at 04:12:34PM -0400, James Coleman wrote: > >> >On

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

2020-05-08 Thread Tomas Vondra
On Fri, May 08, 2020 at 07:25:36PM -0300, Ranier Vilela wrote: Em sex., 8 de mai. de 2020 às 19:02, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: On Thu, Apr 23, 2020 at 04:12:34PM -0400, James Coleman wrote: >On Thu, Apr 23, 2020 at 8:38 AM Ranier Vilela wrote: >> >> Hi, >> >> Per

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

2020-05-08 Thread Ranier Vilela
Em sex., 8 de mai. de 2020 às 19:02, Tomas Vondra < tomas.von...@2ndquadrant.com> escreveu: > On Thu, Apr 23, 2020 at 04:12:34PM -0400, James Coleman wrote: > >On Thu, Apr 23, 2020 at 8:38 AM Ranier Vilela > wrote: > >> > >> Hi, > >> > >> Per Coverity. > >> > >> If has 0 full groups, "we don't

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

2020-05-08 Thread Tomas Vondra
On Thu, Apr 23, 2020 at 04:12:34PM -0400, James Coleman wrote: On Thu, Apr 23, 2020 at 8:38 AM Ranier Vilela 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

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

2020-04-23 Thread James Coleman
On Thu, Apr 23, 2020 at 8:38 AM Ranier Vilela 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

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

2020-04-23 Thread Ranier Vilela
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