Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fd54914

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 6588d84 commit fd54914

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/regress/expected/hash_func.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
348348
t
349349
(1 row)
350350

351-
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
351+
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
352352
t
353353
---
354354
t
@@ -360,7 +360,7 @@ SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
360360
t
361361
(1 row)
362362

363-
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
363+
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
364364
t
365365
---
366366
t

src/test/regress/sql/hash_func.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ DROP TYPE hash_test_t2;
258258
-- Check special cases for specific data types
259259
--
260260
SELECT hashfloat4('0'::float4) = hashfloat4('-0'::float4) AS t;
261-
SELECT hashfloat4('NaN'::float4) = hashfloat4('-NaN'::float4) AS t;
261+
SELECT hashfloat4('NaN'::float4) = hashfloat4(-'NaN'::float4) AS t;
262262
SELECT hashfloat8('0'::float8) = hashfloat8('-0'::float8) AS t;
263-
SELECT hashfloat8('NaN'::float8) = hashfloat8('-NaN'::float8) AS t;
263+
SELECT hashfloat8('NaN'::float8) = hashfloat8(-'NaN'::float8) AS t;
264264
SELECT hashfloat4('NaN'::float4) = hashfloat8('NaN'::float8) AS t;

0 commit comments

Comments
 (0)