1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

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.
This commit is contained in:
Tom Lane
2008-07-23 17:29:53 +00:00
parent 509303a597
commit 11c794f224
3 changed files with 20 additions and 7 deletions

View File

@ -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;