Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9c5e96

Browse files
committed
Give up on testing guc.c's behavior for "infinity" inputs.
Further buildfarm testing shows that on the machines that are failingac75959's test case, what we're actually getting from strtod("-infinity")is a syntax error (endptr == value) not ERANGE at all. This test caseis not worth carrying two sets of expected output for, so just remove it,and revert commitb212245's misguided attempt to work around the platformdependency.Discussion:https://postgr.es/m/E1h33xk-0001Og-Gs@gemulon.postgresql.org
1 parent8cacea7 commitd9c5e96

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6240,15 +6240,13 @@ parse_real(const char *value, double *result, int flags, const char **hintmsg)
62406240
if (hintmsg)
62416241
*hintmsg=NULL;
62426242

6243+
errno=0;
62436244
val=strtod(value,&endptr);
6244-
if (endptr==value)
6245-
return false;/* no HINT for syntax error */
62466245

6247-
/*
6248-
* We ignore strtod's errno, so that out-of-range inputs will just result
6249-
* in zero or infinity values. Subsequent range checks will reject those
6250-
* if necessary. We do need to reject NaN explicitly, however.
6251-
*/
6246+
if (endptr==value||errno==ERANGE)
6247+
return false;/* no HINT for these cases */
6248+
6249+
/* reject NaN (infinities will fail range checks later) */
62526250
if (isnan(val))
62536251
return false;/* treat same as syntax error; no HINT */
62546252

‎src/test/regress/expected/guc.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,6 @@ SET seq_page_cost TO 'NaN';
511511
ERROR: invalid value for parameter "seq_page_cost": "NaN"
512512
SET vacuum_cost_delay TO '10s';
513513
ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100)
514-
SET geqo_selection_bias TO '-infinity';
515-
ERROR: -Infinity is outside the valid range for parameter "geqo_selection_bias" (1.5 .. 2)
516514
--
517515
-- Test DISCARD TEMP
518516
--

‎src/test/regress/sql/guc.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ SELECT '2006-08-13 12:34:56'::timestamptz;
147147
-- Test some simple error cases
148148
SET seq_page_cost TO'NaN';
149149
SET vacuum_cost_delay TO'10s';
150-
SET geqo_selection_bias TO'-infinity';
151150

152151
--
153152
-- Test DISCARD TEMP

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp