BUG #17172: NaN compare error in hash agg

The Post Office <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ma100@hotmail.com
Date: 2021-09-01T02:25:31Z
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17172
Logged by:          ma liangzhu
Email address:      ma100@hotmail.com
PostgreSQL version: 14beta1
Operating system:   centos7
Description:        

postgres=# select '-NaN'::float union select ('Infinity'::float +
'-Infinity') union select 'NaN';
 float8 
--------
    NaN
    NaN
(2 rows)

postgres=# set enable_hashagg =0;
SET
postgres=# select '-NaN'::float union select ('Infinity'::float +
'-Infinity') union select 'NaN';
 float8 
--------
    NaN
(1 row)

Commits

  1. Fix float4/float8 hash functions to produce uniform results for NaNs.