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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy