Re: BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tcook(at)blackducksoftware(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail
Date: 2017-12-21 17:31:44
Message-ID: 26089.1513877504@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tony Finch 2017-12-21 17:40:08 psql cannot read client SSL private key from a pipe
Previous Message PG Bug reporting form 2017-12-21 16:58:00 BUG #14990: hashint4() <> hashint8() for small negative values, causing hash joins to fail