bug in float8in() - Mailing list pgsql-hackers

From Richard Wang
Subject bug in float8in()
Date
Msg-id fsv83l$14a6$1@news.hub.org
Whole thread Raw
Responses Re: bug in float8in()  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Re: bug in float8in()  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
I run the following sql statements in linux and get the results:
postgres=# create table test_double(col1 float8);
CREATE TABLE
postgres=# insert into test_double values(1.7976931348623159E308);
INSERT 0 1
postgres=# select * from test_double;  col1
----------Infinity
(1 row)

but in windows:
postgres=# create table test_double(col1 float8);
CREATE TABLE
postgres=# insert into test_double values(1.7976931348623159E308);
ERROR: 
"17976931348623159000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000"
is out of range for type double precision
postgres=# select * from test_double;col1
------
(0 rows)

This is a bug, the behavior in windows and linux is not the smae

I check the code and find that float8in exists a bug:
the strtod() function in linux dosen't set errno when dealing with 
1.7976931348623159E308 but in windows it does
How should we improve it?




pgsql-hackers by date:

Previous
From: James Mansion
Date:
Subject: notify with payload (pgkill, notify)
Next
From: NikhilS
Date:
Subject: Re: [BUGS] Problem identifying constraints which should not be inherited