Make sure float4in/float8in accept all standard spellings of "infinity".

The C99 and POSIX standards require strtod() to accept all these spellings
(case-insensitively): "inf", "+inf", "-inf", "infinity", "+infinity",
"-infinity". However, pre-C99 systems might accept only some or none of
these, and apparently Windows still doesn't accept "inf". To avoid
surprising cross-platform behavioral differences, manually check for each
of these spellings if strtod() fails. We were previously handling just
"infinity" and "-infinity" that way, but since C99 is most of the world
now, it seems likely that applications are expecting all these spellings
to work.

Per bug #8355 from Basil Peace. It turns out this fix won't actually
resolve his problem, because Python isn't being this careful; but that
doesn't mean we shouldn't be.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/de27c2985f81801c1f9198159d379a036d472943

Modified Files
--------------
src/backend/utils/adt/float.c | 106 +++++++++++++++++++++++++++++++----------
1 file changed, 81 insertions(+), 25 deletions(-)

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
grouppgsql-committers @
categoriespostgresql
postedAug 3, '13 at 4:41p
activeAug 3, '13 at 4:41p
posts6
users1
websitepostgresql.org...
irc#postgresql

1 user in discussion

Tom Lane: 6 posts

People

Translate

site design / logo © 2018 Grokbase