diff options
Diffstat (limited to 'src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc')
-rw-r--r-- | src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc index b5a9e5d863..30301fc0df 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc @@ -964,7 +964,14 @@ MySqlConfigBackendImpl::createUpdateServer(const int& create_audit_revision, uint64_t MySqlConfigBackendImpl::deleteServer(const int& create_audit_revision, const int& delete_index, - const std::string& server_tag) { + const ServerTag& server_tag) { + + // It is not allowed to delete 'all' logical server. + if (server_tag.amAll()) { + isc_throw(InvalidOperation, "'all' is a name reserved for the server tag which" + " associates the configuration elements with all servers connecting" + " to the database and can't be deleted"); + } MySqlTransaction transaction(conn_); @@ -976,7 +983,7 @@ MySqlConfigBackendImpl::deleteServer(const int& create_audit_revision, // Specify which server should be deleted. MySqlBindingCollection in_bindings = { - MySqlBinding::createString(server_tag) + MySqlBinding::createString(server_tag.get()) }; // Attempt to delete the server. |