2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-04 16:05:17 +00:00

[392-search-of-reservations-by-hostname] Addressed some comments

This commit is contained in:
Francis Dupont
2019-10-14 16:30:18 +02:00
parent a9b5fc5646
commit fbaa30d93d
6 changed files with 30 additions and 0 deletions

View File

@@ -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 $ 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: .. _pgsql-database:
PostgreSQL PostgreSQL

View File

@@ -141,6 +141,10 @@ public:
/// This method returns all @c Host objects which represent reservations /// This method returns all @c Host objects which represent reservations
/// using a specified hostname. /// 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. /// @param hostname The lower case hostname.
/// ///
/// @return Collection of const @c Host objects. /// @return Collection of const @c Host objects.

View File

@@ -198,6 +198,8 @@ public:
/// This method returns all @c Host objects which represent reservations /// This method returns all @c Host objects which represent reservations
/// using a specified hostname. /// using a specified hostname.
/// ///
/// Cassandra uses the new indexed lower_case_hostname column.
///
/// @param hostname The lower case hostname. /// @param hostname The lower case hostname.
/// ///
/// @return Collection of const @c Host objects. /// @return Collection of const @c Host objects.

View File

@@ -91,6 +91,7 @@ typedef boost::multi_index_container<
>, >,
// Sixth index is used to search for the host using hostname // 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< boost::multi_index::ordered_non_unique<
// Index using values returned by the @c Host::getLowerHostname // Index using values returned by the @c Host::getLowerHostname
boost::multi_index::const_mem_fun<Host, std::string, boost::multi_index::const_mem_fun<Host, std::string,

View File

@@ -158,6 +158,8 @@ public:
/// This method returns all @c Host objects which represent reservations /// This method returns all @c Host objects which represent reservations
/// using a specified hostname. /// using a specified hostname.
/// ///
/// MySQL uses the case-insensitive hosts_by_hostname index on hostname.
///
/// @param hostname The lower case hostname. /// @param hostname The lower case hostname.
/// ///
/// @return Collection of const @c Host objects. /// @return Collection of const @c Host objects.

View File

@@ -187,6 +187,8 @@ public:
/// This method returns all @c Host objects which represent reservations /// This method returns all @c Host objects which represent reservations
/// using a specified hostname. /// using a specified hostname.
/// ///
/// PostgreSQL uses the hosts_by_hostname index on LOWER(hostname).
///
/// @param hostname The lower case hostname. /// @param hostname The lower case hostname.
/// ///
/// @return Collection of const @c Host objects. /// @return Collection of const @c Host objects.