Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eS4hE-000190-Do for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Dec 2017 17:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eS4hD-0004Ge-NQ for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Dec 2017 17:31:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eS4hD-0004GT-EZ for pgsql-bugs@lists.postgresql.org; Thu, 21 Dec 2017 17:31:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eS4hB-0003au-5F for pgsql-bugs@postgresql.org; Thu, 21 Dec 2017 17:31:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vBLHVibH026090; Thu, 21 Dec 2017 12:31:44 -0500 From: Tom Lane To: tcook@blackducksoftware.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail In-reply-to: <20171221165800.826.12026@wrigleys.postgresql.org> References: <20171221165800.826.12026@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Thu, 21 Dec 2017 16:58:00 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26088.1513877504.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 21 Dec 2017 12:31:44 -0500 Message-ID: <26089.1513877504@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?utf-8?q?PG_Bug_reporting_form?=3D writes: > However, for small-magnitude negative numbers, hashint8() and hashint4()= do > not produce the same results: Hm, it works as expected for me. What compiler and compile options did you use? regression=3D# select i, hashint2(i::smallint), hashint4(i), hashint8(i::b= igint) from generate_series(-10,10) i; i | hashint2 | hashint4 | hashint8 = -----+-------------+-------------+------------- -10 | 1890576549 | 1890576549 | 1890576549 -9 | 108489501 | 108489501 | 108489501 -8 | 1704507032 | 1704507032 | 1704507032 -7 | -82204417 | -82204417 | -82204417 -6 | -2107898529 | -2107898529 | -2107898529 -5 | 1412886042 | 1412886042 | 1412886042 -4 | 174778200 | 174778200 | 174778200 -3 | -1044245375 | -1044245375 | -1044245375 -2 | -1242090879 | -1242090879 | -1242090879 -1 | 385747274 | 385747274 | 385747274 0 | -272711505 | -272711505 | -272711505 1 | -1905060026 | -1905060026 | -1905060026 2 | 1134484726 | 1134484726 | 1134484726 3 | -28094569 | -28094569 | -28094569 4 | -1011077333 | -1011077333 | -1011077333 5 | -1330264708 | -1330264708 | -1330264708 6 | 566031088 | 566031088 | 566031088 7 | -978793473 | -978793473 | -978793473 8 | -2047600124 | -2047600124 | -2047600124 9 | 1672378334 | 1672378334 | 1672378334 10 | -1547814713 | -1547814713 | -1547814713 (21 rows) regards, tom lane