Re: pgsql: Fix behavior of ~> (cube, int) operator - Mailing list pgsql-committers

From Alexander Korotkov
Subject Re: pgsql: Fix behavior of ~> (cube, int) operator
Date
Msg-id CAPpHfdvTakCmjcbAcsaSB0XZ=WCLHRTmA+F2N3P12OCOWZfjBQ@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Fix behavior of ~> (cube, int) operator  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Fix behavior of ~> (cube, int) operator  (Teodor Sigaev <teodor@sigaev.ru>)
Re: pgsql: Fix behavior of ~> (cube, int) operator  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-committers
On Sun, Jan 21, 2018 at 11:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Teodor Sigaev <teodor@sigaev.ru> writes:
> Fix behavior of ~> (cube, int) operator

This patch has caused Coverity to complain, correctly AFAICS, about
dead code in cube_coord_llur in the back branches:

1628            /* Inverse value if needed */
1629            if (inverse)
>>>     CID 1463943:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "result = -result;".
1630                    result = -result;
1631
1632            PG_RETURN_FLOAT8(result);

Seems to be due to sloppy division of changes between f50c80dbb (which
was not back-patched) and 563a053bd.  Please fix.

Thank you for catching this.  You diagnosis is right.
I propose to commit the attached patch to 10 and 9.6.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 
Attachment

pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: Re: pgsql: Support partition pruning at execution time
Next
From: Teodor Sigaev
Date:
Subject: Re: pgsql: Fix behavior of ~> (cube, int) operator