]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5651] Removed unused SQL/CQL queries.
authorMarcin Siodelski <marcin@isc.org>
Thu, 28 Jun 2018 14:50:07 +0000 (16:50 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 28 Jun 2018 14:50:07 +0000 (16:50 +0200)
src/lib/dhcpsrv/cql_lease_mgr.cc
src/lib/dhcpsrv/mysql_lease_mgr.cc
src/lib/dhcpsrv/mysql_lease_mgr.h
src/lib/dhcpsrv/pgsql_lease_mgr.cc
src/lib/dhcpsrv/pgsql_lease_mgr.h

index 19494f7619d5cb71b683d4c8435ebbe856b99253..598fe60e0d2dc6e2aa570de3e5293a5cd5922c93 100644 (file)
@@ -222,8 +222,6 @@ public:
     static constexpr StatementTag GET_LEASE4_LIMIT = "GET_LEASE4_LIMIT";
     // Get range of lease4 from address with limit (paging)
     static constexpr StatementTag GET_LEASE4_PAGE = "GET_LEASE4_PAGE";
-    // Get range of lease4 between two addresses
-    static constexpr StatementTag GET_LEASE4_RANGE = "GET_LEASE4_RANGE";
     // Get lease4 by subnet ID
     static constexpr StatementTag GET_LEASE4_SUBID = "GET_LEASE4_SUBID";
     /// @}
@@ -249,7 +247,6 @@ constexpr StatementTag CqlLease4Exchange::GET_LEASE4_HWADDR;
 constexpr StatementTag CqlLease4Exchange::GET_LEASE4_HWADDR_SUBID;
 constexpr StatementTag CqlLease4Exchange::GET_LEASE4_LIMIT;
 constexpr StatementTag CqlLease4Exchange::GET_LEASE4_PAGE;
-constexpr StatementTag CqlLease4Exchange::GET_LEASE4_RANGE;
 constexpr StatementTag CqlLease4Exchange::GET_LEASE4_SUBID;
 
 StatementMap CqlLease4Exchange::tagged_statements_{
@@ -380,17 +377,6 @@ StatementMap CqlLease4Exchange::tagged_statements_{
       "LIMIT ? "
       "ALLOW FILTERING "}},
 
-    // Get range of lease4 between two addresses
-    {GET_LEASE4_RANGE,
-     {GET_LEASE4_RANGE,
-      "SELECT "
-      "address, hwaddr, client_id, valid_lifetime, expire, subnet_id, "
-      "fqdn_fwd, fqdn_rev, hostname, state "
-      "FROM lease4 "
-      "WHERE address >= ? "
-      "AND address <= ? "
-      "ALLOW FILTERING "}},
-
      // Gets an IPv4 lease(s) with specified subnet-id
      {GET_LEASE4_SUBID,
       {GET_LEASE4_SUBID,
index c52cf94acbc8836736d4b7a0a818279ee05fd83f..39ff1be6622ae151e609392deeee24877c9224c1 100644 (file)
@@ -147,13 +147,6 @@ tagged_statements = { {
                             "WHERE address > ? "
                             "ORDER BY address "
                             "LIMIT ?"},
-    {MySqlLeaseMgr::GET_LEASE4_RANGE,
-                    "SELECT address, hwaddr, client_id, "
-                        "valid_lifetime, expire, subnet_id, "
-                        "fqdn_fwd, fqdn_rev, hostname, "
-                        "state "
-                            "FROM lease4 "
-                            "WHERE address >= ? AND address <= ?"},
     {MySqlLeaseMgr::GET_LEASE4_SUBID,
                     "SELECT address, hwaddr, client_id, "
                         "valid_lifetime, expire, subnet_id, "
@@ -217,16 +210,6 @@ tagged_statements = { {
                             "WHERE address > ? "
                             "ORDER BY address "
                             "LIMIT ?"},
-    {MySqlLeaseMgr::GET_LEASE6_RANGE,
-                    "SELECT address, duid, valid_lifetime, "
-                        "expire, subnet_id, pref_lifetime, "
-                        "lease_type, iaid, prefix_len, "
-                        "fqdn_fwd, fqdn_rev, hostname, "
-                        "hwaddr, hwtype, hwaddr_source, "
-                        "state "
-                            "FROM lease6 "
-                            "WHERE INET6_ATON(address) >= INET6_ATON(?) "
-                                "AND INET6_ATON(address) <= INET6_ATON(?)"},
     {MySqlLeaseMgr::GET_LEASE6_SUBID,
                     "SELECT address, duid, valid_lifetime, "
                         "expire, subnet_id, pref_lifetime, "
index bb1a7738a9ce043756e14929f44e7a30dfea69d0..ede95dcecfb91d247e70740784661f48de28dc6c 100644 (file)
@@ -572,7 +572,6 @@ public:
         GET_LEASE4_HWADDR,           // Get lease4 by HW address
         GET_LEASE4_HWADDR_SUBID,     // Get lease4 by HW address & subnet ID
         GET_LEASE4_PAGE,             // Get page of leases beginning with an address
-        GET_LEASE4_RANGE,            // Get range of leases between addresses
         GET_LEASE4_SUBID,            // Get IPv4 leases by subnet ID
         GET_LEASE4_EXPIRE,           // Get lease4 by expiration.
         GET_LEASE6,                  // Get all IPv6 leases
@@ -580,7 +579,6 @@ public:
         GET_LEASE6_DUID_IAID,        // Get lease6 by DUID and IAID
         GET_LEASE6_DUID_IAID_SUBID,  // Get lease6 by DUID, IAID and subnet ID
         GET_LEASE6_PAGE,             // Get page of leases beginning with an address
-        GET_LEASE6_RANGE,            // Get range of leases between addresses
         GET_LEASE6_SUBID,            // Get IPv6 leases by subnet ID
         GET_LEASE6_EXPIRE,           // Get lease6 by expiration.
         INSERT_LEASE4,               // Add entry to lease4 table
index 561a2e71871f6c784f32b750bd6ebd7a54b3abcb..676f02619810f310d2e4b5bfd5dd99cffc8a8374 100644 (file)
@@ -124,16 +124,6 @@ PgSqlTaggedStatement tagged_statements[] = {
       "ORDER BY address "
       "LIMIT $2"},
 
-    // GET_LEASE4_RANGE
-    { 2, { OID_INT8, OID_INT8 },
-      "get_lease4_range",
-      "SELECT address, hwaddr, client_id, "
-        "valid_lifetime, extract(epoch from expire)::bigint, subnet_id, "
-        "fqdn_fwd, fqdn_rev, hostname, "
-        "state "
-      "FROM lease4 "
-      "WHERE address >= $1 AND address <= $2"},
-
     // GET_LEASE4_SUBID
     { 1, { OID_INT8 },
       "get_lease4_subid",
@@ -213,17 +203,6 @@ PgSqlTaggedStatement tagged_statements[] = {
       "ORDER BY address "
       "LIMIT $2"},
 
-    // GET_LEASE6_RANGE
-    { 2, { OID_VARCHAR, OID_VARCHAR },
-      "get_lease6_range",
-      "SELECT address, duid, valid_lifetime, "
-        "extract(epoch from expire)::bigint, subnet_id, pref_lifetime, "
-        "lease_type, iaid, prefix_len, fqdn_fwd, fqdn_rev, hostname, "
-        "hwaddr, hwtype, hwaddr_source, "
-        "state "
-      "FROM lease6 "
-      "WHERE INET(address) >= INET($1) AND INET(address) <= INET($2)"},
-
     // GET_LEASE6_SUBID
     { 1, { OID_INT8 },
       "get_lease6_subid",
index 9df8cf9c00658cf4dec64079bb2679a9cee18d41..e80a20f2b2f704f3bfc18d9dce7529529c99b3e5 100644 (file)
@@ -540,7 +540,6 @@ public:
         GET_LEASE4_HWADDR,          // Get lease4 by HW address
         GET_LEASE4_HWADDR_SUBID,    // Get lease4 by HW address & subnet ID
         GET_LEASE4_PAGE,            // Get page of leases beginning with an address
-        GET_LEASE4_RANGE,           // Get range of leases between addresses
         GET_LEASE4_SUBID,           // Get IPv4 leases by subnet ID
         GET_LEASE4_EXPIRE,          // Get expired lease4
         GET_LEASE6,                 // Get all IPv6 leases
@@ -548,7 +547,6 @@ public:
         GET_LEASE6_DUID_IAID,       // Get lease6 by DUID and IAID
         GET_LEASE6_DUID_IAID_SUBID, // Get lease6 by DUID, IAID and subnet ID
         GET_LEASE6_PAGE,            // Get page of IPv6 leases beginning with an address
-        GET_LEASE6_RANGE,           // Get range of IPv6 leases between addresses
         GET_LEASE6_SUBID,           // Get IPv6 leases by subnet ID
         GET_LEASE6_EXPIRE,          // Get expired lease6
         INSERT_LEASE4,              // Add entry to lease4 table