]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix thinko in multi-autovac-workers code: validity checks made by
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2007 16:00:46 +0000 (16:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2007 16:00:46 +0000 (16:00 +0000)
GUC assign hooks are supposed to be made whether doit is true or not.

src/backend/utils/misc/guc.c

index 45fef6d7a3128e3502481cbb97171210486f4396..09cd8ca44813f946a0b5b0ae11970cd5fce720b5 100644 (file)
@@ -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;
 }