Commit af1022d2 authored by Tom Lane's avatar Tom Lane

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.
parent 849ec997
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * 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) ...@@ -6956,13 +6956,11 @@ show_tcp_keepalives_count(void)
static bool static bool
assign_maxconnections(int newval, bool doit, GucSource source) assign_maxconnections(int newval, bool doit, GucSource source)
{ {
if (doit)
{
if (newval + autovacuum_max_workers > INT_MAX / 4) if (newval + autovacuum_max_workers > INT_MAX / 4)
return false; return false;
if (doit)
MaxBackends = newval + autovacuum_max_workers; MaxBackends = newval + autovacuum_max_workers;
}
return true; return true;
} }
...@@ -6970,13 +6968,11 @@ assign_maxconnections(int newval, bool doit, GucSource source) ...@@ -6970,13 +6968,11 @@ assign_maxconnections(int newval, bool doit, GucSource source)
static bool static bool
assign_autovacuum_max_workers(int newval, bool doit, GucSource source) assign_autovacuum_max_workers(int newval, bool doit, GucSource source)
{ {
if (doit)
{
if (newval + MaxConnections > INT_MAX / 4) if (newval + MaxConnections > INT_MAX / 4)
return false; return false;
if (doit)
MaxBackends = newval + MaxConnections; MaxBackends = newval + MaxConnections;
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment