]> granicus.if.org Git - postgresql/commit
Make sure float4in/float8in accept all standard spellings of "infinity".
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Aug 2013 16:39:54 +0000 (12:39 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Aug 2013 16:40:40 +0000 (12:40 -0400)
commitcbb565f7c397fa8a74b214e1765ed9db66c3d8a4
treed684004dbd3de741720202614188f2ff87d191a3
parent08767878ca865a021763c8650b57df65b40094cd
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.
src/backend/utils/adt/float.c