From 55e0e458170c76c1a0074cd550a13ec47e38a3fa Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 20 Apr 2018 19:54:58 -0400 Subject: [PATCH] Test conversion of NaN between float4 and float8. Results from buildfarm member opossum suggest that this doesn't work quite right on that platform. We've seen issues with NaN support on MIPS/NetBSD before ... allegedly they fixed this stuff back in 2010, but maybe only for small values of "fixed". If, in fact, opossum fails this test then I plan to revert it; it's mainly for diagnostic purposes rather than something we'd necessarily keep long-term. I think that the failures in window.sql could be worked around with some code duplication, but I want to verify my theory about the cause first. --- .../regress/expected/float4-exp-three-digits.out | 12 ++++++++++++ src/test/regress/expected/float4.out | 12 ++++++++++++ src/test/regress/sql/float4.sql | 2 ++ 3 files changed, 26 insertions(+) diff --git a/src/test/regress/expected/float4-exp-three-digits.out b/src/test/regress/expected/float4-exp-three-digits.out index f17f95697a..ea6f77a671 100644 --- a/src/test/regress/expected/float4-exp-three-digits.out +++ b/src/test/regress/expected/float4-exp-three-digits.out @@ -125,6 +125,18 @@ SELECT 'nan'::numeric::float4; NaN (1 row) +SELECT 'nan'::float8::float4; + float4 +-------- + NaN +(1 row) + +SELECT 'nan'::float4::float8; + float8 +-------- + NaN +(1 row) + SELECT '' AS five, * FROM FLOAT4_TBL; five | f1 ------+-------------- diff --git a/src/test/regress/expected/float4.out b/src/test/regress/expected/float4.out index fd46a4a1db..ab9b1acd49 100644 --- a/src/test/regress/expected/float4.out +++ b/src/test/regress/expected/float4.out @@ -125,6 +125,18 @@ SELECT 'nan'::numeric::float4; NaN (1 row) +SELECT 'nan'::float8::float4; + float4 +-------- + NaN +(1 row) + +SELECT 'nan'::float4::float8; + float8 +-------- + NaN +(1 row) + SELECT '' AS five, * FROM FLOAT4_TBL; five | f1 ------+------------- diff --git a/src/test/regress/sql/float4.sql b/src/test/regress/sql/float4.sql index 3b363f9463..e6f5c7425d 100644 --- a/src/test/regress/sql/float4.sql +++ b/src/test/regress/sql/float4.sql @@ -41,6 +41,8 @@ SELECT 'Infinity'::float4 + 100.0; SELECT 'Infinity'::float4 / 'Infinity'::float4; SELECT 'nan'::float4 / 'nan'::float4; SELECT 'nan'::numeric::float4; +SELECT 'nan'::float8::float4; +SELECT 'nan'::float4::float8; SELECT '' AS five, * FROM FLOAT4_TBL;