From: Thomas Markwalder Date: Thu, 25 Aug 2016 15:42:54 +0000 (-0400) Subject: [master] kea-dhcp4 and kea-dhcp6 now recalculate lease stats after reconfigure X-Git-Tag: trac4631_base~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0abdcf15f85861ffcb67d50fa4ce3965d25e4a9f;p=thirdparty%2Fkea.git [master] kea-dhcp4 and kea-dhcp6 now recalculate lease stats after reconfigure Merges in trac4294 --- 0abdcf15f85861ffcb67d50fa4ce3965d25e4a9f diff --cc src/lib/dhcpsrv/mysql_lease_mgr.cc index 8edf4dfc5c,0017a690d3..344fb272fc --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@@ -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" } + } }; };