Give up on testing guc.c's behavior for "infinity" inputs.
Further buildfarm testing shows that on the machines that are failing ac75959cd's test case, what we're actually getting from strtod("-infinity") is a syntax error (endptr == value) not ERANGE at all. This test case is not worth carrying two sets of expected output for, so just remove it, and revert commit b212245f9's misguided attempt to work around the platform dependency. Discussion: https://postgr.es/m/E1h33xk-0001Og-Gs@gemulon.postgresql.org
This commit is contained in:
parent
8cacea7a72
commit
d9c5e9629b
@ -6240,15 +6240,13 @@ parse_real(const char *value, double *result, int flags, const char **hintmsg)
|
|||||||
if (hintmsg)
|
if (hintmsg)
|
||||||
*hintmsg = NULL;
|
*hintmsg = NULL;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
val = strtod(value, &endptr);
|
val = strtod(value, &endptr);
|
||||||
if (endptr == value)
|
|
||||||
return false; /* no HINT for syntax error */
|
|
||||||
|
|
||||||
/*
|
if (endptr == value || errno == ERANGE)
|
||||||
* We ignore strtod's errno, so that out-of-range inputs will just result
|
return false; /* no HINT for these cases */
|
||||||
* in zero or infinity values. Subsequent range checks will reject those
|
|
||||||
* if necessary. We do need to reject NaN explicitly, however.
|
/* reject NaN (infinities will fail range checks later) */
|
||||||
*/
|
|
||||||
if (isnan(val))
|
if (isnan(val))
|
||||||
return false; /* treat same as syntax error; no HINT */
|
return false; /* treat same as syntax error; no HINT */
|
||||||
|
|
||||||
|
@ -511,8 +511,6 @@ SET seq_page_cost TO 'NaN';
|
|||||||
ERROR: invalid value for parameter "seq_page_cost": "NaN"
|
ERROR: invalid value for parameter "seq_page_cost": "NaN"
|
||||||
SET vacuum_cost_delay TO '10s';
|
SET vacuum_cost_delay TO '10s';
|
||||||
ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100)
|
ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100)
|
||||||
SET geqo_selection_bias TO '-infinity';
|
|
||||||
ERROR: -Infinity is outside the valid range for parameter "geqo_selection_bias" (1.5 .. 2)
|
|
||||||
--
|
--
|
||||||
-- Test DISCARD TEMP
|
-- Test DISCARD TEMP
|
||||||
--
|
--
|
||||||
|
@ -147,7 +147,6 @@ SELECT '2006-08-13 12:34:56'::timestamptz;
|
|||||||
-- Test some simple error cases
|
-- Test some simple error cases
|
||||||
SET seq_page_cost TO 'NaN';
|
SET seq_page_cost TO 'NaN';
|
||||||
SET vacuum_cost_delay TO '10s';
|
SET vacuum_cost_delay TO '10s';
|
||||||
SET geqo_selection_bias TO '-infinity';
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Test DISCARD TEMP
|
-- Test DISCARD TEMP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user