pgsql: Make sure float4in/float8in accept all standard spellings of "in

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make sure float4in/float8in accept all standard spellings of "in
Date: 2013-08-03 16:41:10
Message-ID: E1V5etC-0002rT-Ho@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
REL9_3_STABLE

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

Modified Files
--------------
src/backend/utils/adt/float.c | 98 +++++++++++++++++++++++++++++++----------
1 file changed, 75 insertions(+), 23 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Kevin Grittner 2013-08-05 14:59:32 pgsql: Various cleanups for REFRESH MATERIALIZED VIEW CONCURRENTLY.
Previous Message Alvaro Herrera 2013-08-02 21:11:13 pgsql: Fix old visibility bug in HeapTupleSatisfiesDirty