pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow NaN as a value for floating-point GUCs.
Date: Sun, 10 Mar 2019 16:59:39 +0000
Message-ID: <E1h31nX-0006xB-Sk@gemulon.postgresql.org> (raw)

Disallow NaN as a value for floating-point GUCs.

None of the code that uses GUC values is really prepared for them to
hold NaN, but parse_real() didn't have any defense against accepting
such a value.  Treat it the same as a syntax error.

I haven't attempted to analyze the exact consequences of setting any
of the float GUCs to NaN, but since they're quite unlikely to be good,
this seems like a back-patchable bug fix.

Note: we don't need an explicit test for +-Infinity because those will
be rejected by existing range checks.  I added a regression test for
that in HEAD, but not older branches because the spelling of the value
in the error message will be platform-dependent in branches where we
don't always use port/snprintf.c.

Discussion: https://postgr.es/m/1798.1552165479@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f9ec64df8f25ecf69f870682abc6ff0950641610

Modified Files
--------------
src/backend/utils/misc/guc.c      | 4 ++++
src/test/regress/expected/guc.out | 5 +++++
src/test/regress/sql/guc.sql      | 4 ++++
3 files changed, 13 insertions(+)



view thread (6+ messages)

Message-ID: <E1h31nX-0006xB-Sk@gemulon.postgresql.org>
Permalink:  ../E1h31nX-0006xB-Sk@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h31nX-0006xB-Sk@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Disallow NaN as a value for floating-point GUCs.
  In-Reply-To: <E1h31nX-0006xB-Sk@gemulon.postgresql.org>
  References: <E1h31nX-0006xB-Sk@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox