pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: tcook@blackducksoftware.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail
Date: Thu, 21 Dec 2017 12:31:44 -0500
Message-ID: <26089.1513877504@sss.pgh.pa.us> (raw)
In-Reply-To: <20171221165800.826.12026@wrigleys.postgresql.org>
References: <20171221165800.826.12026@wrigleys.postgresql.org>

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> 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=# select i, hashint2(i::smallint), hashint4(i), hashint8(i::bigint) 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




view thread (4+ messages)  latest in thread

Message-ID: <26089.1513877504@sss.pgh.pa.us>
Permalink:  ../26089.1513877504@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26089.1513877504@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tcook@blackducksoftware.com
  Subject: Re: BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail
  In-Reply-To: <26089.1513877504@sss.pgh.pa.us>
  References: <20171221165800.826.12026@wrigleys.postgresql.org> <26089.1513877504@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox