pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Disallow NaN as a value for floating-point GUCs. 6+ messages / 1 participants [nested] [flat]
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5aafedc2fdbdbe4efcb749b0f20a925436d18d06 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(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e04bb261633dd76d6dc2e250c92f33330ec2891e 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(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bc2232f2f54442417ca2c9a338a6f5495d430153 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(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d8f8183c04671b0ffe26ae6f8aee9e50df5fff1e 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(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ac75959cdc073a09a0d3d649fb922d90e1df4c61 Modified Files -------------- src/backend/utils/misc/guc.c | 4 ++++ src/test/regress/expected/guc.out | 7 +++++++ src/test/regress/sql/guc.sql | 5 +++++ 3 files changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Disallow NaN as a value for floating-point GUCs. @ 2019-03-10 16:59 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-10 16:59 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-03-10 16:59 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-10 16:59 pgsql: Disallow NaN as a value for floating-point GUCs. Tom Lane <tgl@sss.pgh.pa.us>
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