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 368b96d9c184bfd3364abd3e0f31de5706e21b9a..cd70928ce74ff45b93faaca6448e6d9f3819b3b3 100644 (file)
@@ -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;
 }