Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
425
Issues
425
List
Boards
Labels
Service Desk
Milestones
Merge Requests
63
Merge Requests
63
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
fbaa30d9
Commit
fbaa30d9
authored
Oct 14, 2019
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[392-search-of-reservations-by-hostname] Addressed some comments
parent
a9b5fc56
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
0 deletions
+30
-0
doc/sphinx/arm/admin.rst
doc/sphinx/arm/admin.rst
+19
-0
src/lib/dhcpsrv/base_host_data_source.h
src/lib/dhcpsrv/base_host_data_source.h
+4
-0
src/lib/dhcpsrv/cql_host_data_source.h
src/lib/dhcpsrv/cql_host_data_source.h
+2
-0
src/lib/dhcpsrv/host_container.h
src/lib/dhcpsrv/host_container.h
+1
-0
src/lib/dhcpsrv/mysql_host_data_source.h
src/lib/dhcpsrv/mysql_host_data_source.h
+2
-0
src/lib/dhcpsrv/pgsql_host_data_source.h
src/lib/dhcpsrv/pgsql_host_data_source.h
+2
-0
No files found.
doc/sphinx/arm/admin.rst
View file @
fbaa30d9
...
...
@@ -321,6 +321,25 @@ earlier version. To perform an upgrade, issue the following command:
$ kea-admin db-upgrade mysql -u database-user -p database-password -n database-name
.. note::
To search host reservations by hostname it is critical the collation of
the hostname column in the host table to be case-insensitive. Fortunately
the default collation in MySQL is case-insensitive. You can verify this
on your MySQL installation by:
.. code-block:: mysql
mysql> SELECT COLLATION('');
+-----------------+
| COLLATION('') |
+-----------------+
| utf8_general_ci |
+-----------------+
According to the naming of collations when the name finishes by ``_ci``
the collation is case-insensitive.
.. _pgsql-database:
PostgreSQL
...
...
src/lib/dhcpsrv/base_host_data_source.h
View file @
fbaa30d9
...
...
@@ -141,6 +141,10 @@ public:
/// This method returns all @c Host objects which represent reservations
/// using a specified hostname.
///
/// @note: as hostnames are case-insensitive the search key is given
/// in lower cases, search indexes should either be case-insensitive
/// or be case-sensitive using the lower case version of hostnames.
///
/// @param hostname The lower case hostname.
///
/// @return Collection of const @c Host objects.
...
...
src/lib/dhcpsrv/cql_host_data_source.h
View file @
fbaa30d9
...
...
@@ -198,6 +198,8 @@ public:
/// This method returns all @c Host objects which represent reservations
/// using a specified hostname.
///
/// Cassandra uses the new indexed lower_case_hostname column.
///
/// @param hostname The lower case hostname.
///
/// @return Collection of const @c Host objects.
...
...
src/lib/dhcpsrv/host_container.h
View file @
fbaa30d9
...
...
@@ -91,6 +91,7 @@ typedef boost::multi_index_container<
>
,
// Sixth index is used to search for the host using hostname
// (case-sensitive compare so the key is in lower case).
boost
::
multi_index
::
ordered_non_unique
<
// Index using values returned by the @c Host::getLowerHostname
boost
::
multi_index
::
const_mem_fun
<
Host
,
std
::
string
,
...
...
src/lib/dhcpsrv/mysql_host_data_source.h
View file @
fbaa30d9
...
...
@@ -158,6 +158,8 @@ public:
/// This method returns all @c Host objects which represent reservations
/// using a specified hostname.
///
/// MySQL uses the case-insensitive hosts_by_hostname index on hostname.
///
/// @param hostname The lower case hostname.
///
/// @return Collection of const @c Host objects.
...
...
src/lib/dhcpsrv/pgsql_host_data_source.h
View file @
fbaa30d9
...
...
@@ -187,6 +187,8 @@ public:
/// This method returns all @c Host objects which represent reservations
/// using a specified hostname.
///
/// PostgreSQL uses the hosts_by_hostname index on LOWER(hostname).
///
/// @param hostname The lower case hostname.
///
/// @return Collection of const @c Host objects.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment