]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] kea-dhcp4 and kea-dhcp6 now recalculate lease stats after reconfigure
authorThomas Markwalder <tmark@isc.org>
Thu, 25 Aug 2016 15:42:54 +0000 (11:42 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 25 Aug 2016 15:42:54 +0000 (11:42 -0400)
    Merges in trac4294

1  2 
src/lib/dhcpsrv/mysql_lease_mgr.cc
src/lib/dhcpsrv/tests/cfg_db_access_unittest.cc

index 8edf4dfc5cbf29cae63a4d3009a156baf878b7e3,0017a690d36b7fd8198a440ee216552113103b52..344fb272fc0d832e047d925c90f13f339441a701
@@@ -71,6 -70,6 +71,7 @@@ using namespace std
  ///   lease object.
  
  namespace {
++    
  /// @brief Maximum length of the hostname stored in DNS.
  ///
  /// This length is restricted by the length of the domain-name carried
@@@ -206,8 -204,18 +207,15 @@@ tagged_statements = { 
                          "prefix_len = ?, fqdn_fwd = ?, fqdn_rev = ?, "
                          "hostname = ?, hwaddr = ?, hwtype = ?, hwaddr_source = ?, "
                          "state = ? "
-                             "WHERE address = ?"}
+                             "WHERE address = ?"},
+     {MySqlLeaseMgr::RECOUNT_LEASE4_STATS,
+      "SELECT subnet_id, state, count(state) as state_count "
+      "  FROM lease4 GROUP BY subnet_id, state ORDER BY subnet_id"},
 -
+     {MySqlLeaseMgr::RECOUNT_LEASE6_STATS,
+      "SELECT subnet_id, lease_type, state, count(state) as state_count"
+      "  FROM lease6 GROUP BY subnet_id, lease_type, state "
 -     "  ORDER BY subnet_id" },
 -
 -    // End of list sentinel
 -    {MySqlLeaseMgr::NUM_STATEMENTS, NULL}
++     "  ORDER BY subnet_id" }
 +    }
  };
  
  };