Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55e0e45

Browse files
committed
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.
1 parent a0fefbc commit 55e0e45

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/test/regress/expected/float4-exp-three-digits.out

+12
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ SELECT 'nan'::numeric::float4;
125125
NaN
126126
(1 row)
127127

128+
SELECT 'nan'::float8::float4;
129+
float4
130+
--------
131+
NaN
132+
(1 row)
133+
134+
SELECT 'nan'::float4::float8;
135+
float8
136+
--------
137+
NaN
138+
(1 row)
139+
128140
SELECT '' AS five, * FROM FLOAT4_TBL;
129141
five | f1
130142
------+--------------

src/test/regress/expected/float4.out

+12
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ SELECT 'nan'::numeric::float4;
125125
NaN
126126
(1 row)
127127

128+
SELECT 'nan'::float8::float4;
129+
float4
130+
--------
131+
NaN
132+
(1 row)
133+
134+
SELECT 'nan'::float4::float8;
135+
float8
136+
--------
137+
NaN
138+
(1 row)
139+
128140
SELECT '' AS five, * FROM FLOAT4_TBL;
129141
five | f1
130142
------+-------------

src/test/regress/sql/float4.sql

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ SELECT 'Infinity'::float4 + 100.0;
4141
SELECT 'Infinity'::float4 / 'Infinity'::float4;
4242
SELECT 'nan'::float4 / 'nan'::float4;
4343
SELECT 'nan'::numeric::float4;
44+
SELECT 'nan'::float8::float4;
45+
SELECT 'nan'::float4::float8;
4446

4547
SELECT '' AS five, * FROM FLOAT4_TBL;
4648

0 commit comments

Comments
 (0)