Fix portability issue in tests from commit ce773f230.

Modern POSIX seems to require strtod() to accept "-NaN", but there's
nothing about NaN in SUSv2, and some of our oldest buildfarm members
don't like it.  Let's try writing it as -'NaN' instead; that seems
to produce the same result, at least on Intel hardware.

Per buildfarm.
This commit is contained in:
Tom Lane 2021-09-03 10:01:02 -04:00
parent ad66373ead
commit 2836d57e44
2 changed files with 4 additions and 4 deletions

View File

@ -307,7 +307,7 @@ SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
t
(1 row)
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
t
---
t
@ -319,7 +319,7 @@ SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
t
(1 row)
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
t
---
t

View File

@ -225,7 +225,7 @@ WHERE hash_range(v)::bit(32) != hash_range_extended(v, 0)::bit(32)
-- Check special cases for specific data types
--
SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
SELECT hashfloat4('NaN'::float4) = hashfloat8('NaN'::float8) AS t;