Skip to content

Commit 1fab33c

Browse files
committed
Fix portability issue in tests from commit ce773f2.
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.
1 parent a3bf136 commit 1fab33c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/regress/expected/hash_func.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
307307
t
308308
(1 row)
309309

310-
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
310+
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
311311
t
312312
---
313313
t
@@ -319,7 +319,7 @@ SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
319319
t
320320
(1 row)
321321

322-
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
322+
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
323323
t
324324
---
325325
t

src/test/regress/sql/hash_func.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ WHERE hash_range(v)::bit(32) != hash_range_extended(v, 0)::bit(32)
225225
-- Check special cases for specific data types
226226
--
227227
SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
228-
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
228+
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
229229
SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
230-
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
230+
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
231231
SELECT hashfloat4('NaN'::float4) = hashfloat8('NaN'::float8) AS t;

0 commit comments

Comments
 (0)