diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-23 17:29:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-23 17:29:53 +0000 |
commit | 11c794f2249ba6b1d890da309e26e0ddff8bc60c (patch) | |
tree | 40d0a6fdad1bb8fd5350d4034ca7feebb312f416 /src/backend/utils/misc/guc.c | |
parent | 509303a597a1688e6c2230c83634a75f872d270c (diff) | |
download | postgresql-11c794f2249ba6b1d890da309e26e0ddff8bc60c.tar.gz postgresql-11c794f2249ba6b1d890da309e26e0ddff8bc60c.zip |
Use guc.c's parse_int() instead of pg_atoi() to parse fillfactor in
default_reloptions(). The previous coding was really a bug because pg_atoi()
will always throw elog on bad input data, whereas default_reloptions is not
supposed to complain about bad input unless its validate parameter is true.
Right now you could only expose the problem by hand-modifying
pg_class.reloptions into an invalid state, so it doesn't seem worth
back-patching; but we should get it right in HEAD because there might be other
situations in future. Noted while studying GIN fast-update patch.
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 8b072895b1e..874d20c15f1 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.464 2008/07/10 22:08:17 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.465 2008/07/23 17:29:53 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -4115,7 +4115,7 @@ parse_bool(const char *value, bool *result) * If not okay and hintmsg is not NULL, *hintmsg is set to a suitable * HINT message, or NULL if no hint provided. */ -static bool +bool parse_int(const char *value, int *result, int flags, const char **hintmsg) { int64 val; @@ -4322,7 +4322,7 @@ parse_int(const char *value, int *result, int flags, const char **hintmsg) * If the string parses okay, return true, else false. * If okay and result is not NULL, return the value in *result. */ -static bool +bool parse_real(const char *value, double *result) { double val; |