aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-08-08 16:00:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-08-08 16:00:46 +0000
commitaf1022d2cd689ace5ae63136e178253cf87c688b (patch)
treef2bb4b5d9a864b357b37bcf1be62df90ab11e5f4 /src
parent849ec99753982eafd223bdb1c9d854aaca3e8f2f (diff)
downloadpostgresql-af1022d2cd689ace5ae63136e178253cf87c688b.tar.gz
postgresql-af1022d2cd689ace5ae63136e178253cf87c688b.zip
Fix thinko in multi-autovac-workers code: validity checks made by
GUC assign hooks are supposed to be made whether doit is true or not.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/guc.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 45fef6d7a31..09cd8ca4481 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.410 2007/08/04 19:29:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.411 2007/08/08 16:00:46 tgl Exp $
*
*--------------------------------------------------------------------
*/
@@ -6956,13 +6956,11 @@ show_tcp_keepalives_count(void)
static bool
assign_maxconnections(int newval, bool doit, GucSource source)
{
- if (doit)
- {
- if (newval + autovacuum_max_workers > INT_MAX / 4)
- return false;
+ if (newval + autovacuum_max_workers > INT_MAX / 4)
+ return false;
+ if (doit)
MaxBackends = newval + autovacuum_max_workers;
- }
return true;
}
@@ -6970,13 +6968,11 @@ assign_maxconnections(int newval, bool doit, GucSource source)
static bool
assign_autovacuum_max_workers(int newval, bool doit, GucSource source)
{
- if (doit)
- {
- if (newval + MaxConnections > INT_MAX / 4)
- return false;
+ if (newval + MaxConnections > INT_MAX / 4)
+ return false;
+ if (doit)
MaxBackends = newval + MaxConnections;
- }
return true;
}