Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5rXY-00032Z-RV for pgsql-committers@arkaria.postgresql.org; Tue, 10 Apr 2018 11:34:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5rXX-00062o-Q3 for pgsql-committers@arkaria.postgresql.org; Tue, 10 Apr 2018 11:34:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5rXX-00062e-GB for pgsql-committers@lists.postgresql.org; Tue, 10 Apr 2018 11:34:19 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5rXU-0003gd-1T for pgsql-committers@postgresql.org; Tue, 10 Apr 2018 11:34:19 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 8D05B21C1FB8 for ; Tue, 10 Apr 2018 14:34:14 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by mail.postgrespro.ru (Postfix) with ESMTPSA id 0CFD121C1FB3 for ; Tue, 10 Apr 2018 14:34:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1523360054; bh=jVKFypmNVBKMbrUP5ifCDr3NGf7R/2K+C9hPCZ0S+to=; h=In-Reply-To:References:From:Date:Subject:To:Cc; b=OCW7eBvBtP+zY8+JNsUR233w5r2Y08PTaOH7UnZ6iKZRh1bf17ApdlfSAFXL1fDMT 6No6FkvyJzywM3fiumGYoF4cDOgq3h76ZET2uuR9mo1KmtH96eb850zIG7Vp3iknq4 7j+qtQlMLxr27tiWSA+qPWIiX+P/s59jAgDqYxqM= Received: by mail-oi0-f46.google.com with SMTP id x9-v6so10787817oig.7 for ; Tue, 10 Apr 2018 04:34:13 -0700 (PDT) X-Gm-Message-State: ALQs6tCIOfC9QxNnUIVeFiWB79P2cJyKHqLMZrTAcrdrIq+FDlSxIU1H FRLqZHDA3wYmVWAK7XVLWYO3Y4cRxP4I99+JPSI= X-Google-Smtp-Source: AIpwx499KtmWbWyhcKQdlp8yUSUud6O4KN3BS+wIpbBJo6Vl9z7XlfGTPMiNoXLjeaaG5zDNxtzF+W1uCaKKXlkhmlo= X-Received: by 2002:aca:1908:: with SMTP id l8-v6mr1551434oii.265.1523360052381; Tue, 10 Apr 2018 04:34:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.35.146 with HTTP; Tue, 10 Apr 2018 04:33:51 -0700 (PDT) In-Reply-To: <10131.1516566042@sss.pgh.pa.us> References: <10131.1516566042@sss.pgh.pa.us> From: Alexander Korotkov Date: Tue, 10 Apr 2018 14:33:51 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pgsql: Fix behavior of ~> (cube, int) operator To: Tom Lane Cc: Teodor Sigaev , pgsql-committers Content-Type: multipart/mixed; boundary="000000000000c9ab3405697ce6d6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c9ab3405697ce6d6 Content-Type: multipart/alternative; boundary="000000000000c9ab3105697ce6d4" --000000000000c9ab3105697ce6d4 Content-Type: text/plain; charset="UTF-8" On Sun, Jan 21, 2018 at 11:20 PM, Tom Lane wrote: > Teodor Sigaev 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 --000000000000c9ab3105697ce6d4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Jan 21, 20= 18 at 11:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Teodor Sigaev <teodor@s= igaev.ru> writes:
> Fix behavior of ~> (cube, int) operator

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

1628=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Inverse value if needed */=
1629=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (inverse)
>>>=C2=A0 =C2=A0 =C2=A0CID 1463943:=C2=A0 Control flow issues=C2= =A0 (DEADCODE)
>>>=C2=A0 =C2=A0 =C2=A0Execution cannot reach this statement: &quo= t;result =3D -result;".
1630=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 r= esult =3D -result;
1631
1632=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PG_RETURN_FLOAT8(result);

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

Thank you for catching this.=C2=A0 You diagnosis is right.<= /div>
I propose to commit the attached patch to 10 and 9.6.
<= br>
------
Alex= ander Korotkov
Postgres Professional:=C2=A0ht= tp://www.postgrespro.com
The Russian Postgres Company=C2=A0
--000000000000c9ab3105697ce6d4-- --000000000000c9ab3405697ce6d6 Content-Type: application/octet-stream; name="cube_backpatch_fix.patch" Content-Disposition: attachment; filename="cube_backpatch_fix.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jftl769x0 Y29tbWl0IGJlNDlhZjIyMTZhMTI3YTgyMDg5MzY2ZmRiNWIzMzVmYjJmNGUwYzIKQXV0aG9yOiBB bGV4YW5kZXIgS29yb3Rrb3YgPGEua29yb3Rrb3ZAcG9zdGdyZXNwcm8ucnU+CkRhdGU6ICAgVHVl IEFwciAxMCAxNDoyNzo1NSAyMDE4ICswMzAwCgogICAgUmVtb3ZlIHdyb25nbHkgYmFja3BhdGNo ZWQgcGllY2Ugb2YgY29kZSBpbiBjdWJlLmMKICAgIAogICAgRHVlIHRvIHNsb3BweSBkaXZpc2lv biBvZiBjaGFuZ2VzIGJldHdlZW4gZjUwYzgwZGJiICh3aGljaCB3YXMgbm90CiAgICBiYWNrLXBh dGNoZWQpIGFuZCA1NjNhMDUzYmQsIHRoaXMgcGllY2Ugb2YgY29kZSB3YXMgd3JvbmdseSBiYWNr cGF0Y2hlZCB0bwogICAgUkVMXzEwX1NUQUJMRSBhbmQgUkVMOV82X1NUQUJMRS4gIFRoaXMgY29k ZSBuZXZlciBjYXVzZXMgcmVhbCBlcnJvciBiZWNhdXNlCiAgICBpdHMgY29uZGl0aW9uIGlzIG5l dmVyIHNhdGlzZmllZCwgYnV0IGl0J3MgYSBkZWFkIGNvZGUsIHdoaWNoIG5lZWRzIHRvIGJlCiAg ICByZW1vdmVkLgoKZGlmZiAtLWdpdCBhL2NvbnRyaWIvY3ViZS9jdWJlLmMgYi9jb250cmliL2N1 YmUvY3ViZS5jCmluZGV4IGU2OTVhNWUxNmMuLmI3MjA1M2ExZDUgMTAwNjQ0Ci0tLSBhL2NvbnRy aWIvY3ViZS9jdWJlLmMKKysrIGIvY29udHJpYi9jdWJlL2N1YmUuYwpAQCAtMTU5MiwxMSArMTU5 Miw2IEBAIGN1YmVfY29vcmRfbGx1cihQR19GVU5DVElPTl9BUkdTKQogCQkgKi8KIAkJcmVzdWx0 ID0gMC4wOwogCX0KLQotCS8qIEludmVyc2UgdmFsdWUgaWYgbmVlZGVkICovCi0JaWYgKGludmVy c2UpCi0JCXJlc3VsdCA9IC1yZXN1bHQ7Ci0KIAlQR19SRVRVUk5fRkxPQVQ4KHJlc3VsdCk7CiB9 CiAK --000000000000c9ab3405697ce6d6--