Commit fbaa30d9 authored by Francis Dupont's avatar Francis Dupont
Browse files

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

parent a9b5fc56
......@@ -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
......
......@@ -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.
......
......@@ -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.
......
......@@ -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,
......
......@@ -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.
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment