2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

[393-global-search-through-leases-by-mac-or-hostname-w-o-specifying-a-subnet-id] Addressed comments

This commit is contained in:
Francis Dupont
2019-10-25 15:54:34 +02:00
parent fab3f89f77
commit 5cde4dd5d3
5 changed files with 14 additions and 12 deletions

View File

@@ -65,7 +65,7 @@ This library provides the following commands:
- ``lease4-get-by-client-id`` - return all IPv4 leases with the specified
client id.
- ``lease6-get-by-duid`` - returns all IPv6 leases with the specified duid.
- ``lease6-get-by-duid`` - returns all IPv6 leases with the specified DUID.
- ``lease4-get-by-hostname`` - return all IPv4 leases with the specified
hostname.

View File

@@ -145,7 +145,7 @@ PgSqlTaggedStatement tagged_statements[] = {
"fqdn_fwd, fqdn_rev, hostname, "
"state, user_context "
"FROM lease4 "
"WHERE hostname = $1"},
"WHERE lower(hostname) = $1"},
// GET_LEASE4_EXPIRE
{ 3, { OID_INT8, OID_TIMESTAMP, OID_INT8 },
@@ -247,7 +247,7 @@ PgSqlTaggedStatement tagged_statements[] = {
"hwaddr, hwtype, hwaddr_source, "
"state, user_context "
"FROM lease6 "
"WHERE hostname = $1"},
"WHERE lower(hostname) = $1"},
// GET_LEASE6_EXPIRE
{ 3, { OID_INT8, OID_TIMESTAMP, OID_INT8 },

View File

@@ -896,11 +896,11 @@ CREATE INDEX hosts_by_hostname ON hosts (lower(hostname))
WHERE hostname IS NOT NULL;
-- Create a hostname index for lease4.
CREATE INDEX lease4_by_hostname ON lease4 (hostname)
CREATE INDEX lease4_by_hostname ON lease4 (lower(hostname))
WHERE hostname IS NOT NULL;
-- Create a hostname index for lease6.
CREATE INDEX lease6_by_hostname ON lease6 (hostname)
CREATE INDEX lease6_by_hostname ON lease6 (lower(hostname))
WHERE hostname IS NOT NULL;
-- Set 6.0 schema version.

View File

@@ -25,20 +25,22 @@ CREATE INDEX hosts_by_hostname ON hosts (lower(hostname))
WHERE hostname IS NOT NULL;
-- Create a hostname index for lease4.
CREATE INDEX lease4_by_hostname ON lease4 (hostname)
CREATE INDEX lease4_by_hostname ON lease4 (lower(hostname))
WHERE hostname IS NOT NULL;
-- Create a hostname index for lease6.
CREATE INDEX lease6_by_hostname ON lease6 (hostname)
CREATE INDEX lease6_by_hostname ON lease6 (lower(hostname))
WHERE hostname IS NOT NULL;
-- Move to lower case hostnames in lease4 table.
UPDATE lease4 SET hostname = lower(hostname)
WHERE lower(hostname) != hostname;
-- Not required so in comment
-- UPDATE lease4 SET hostname = lower(hostname)
-- WHERE lower(hostname) != hostname;
-- Move to lower case hostnames in lease6 table.
UPDATE lease6 SET hostname = lower(hostname)
WHERE lower(hostname) != hostname;
-- Not required so in comment
-- UPDATE lease6 SET hostname = lower(hostname)
-- WHERE lower(hostname) != hostname;
-- Set 6.0 schema version.
UPDATE schema_version