From: Francis Dupont Date: Sat, 2 Feb 2019 03:29:41 +0000 (+0100) Subject: [354-compilation-with-mysql-fails-on-fedora-29] Fixed MySQL hook on MariaDB X-Git-Tag: 458-config-backend-support-in-src-lib_base~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b53bba76fc7f45c54e02dfa57884a2d0a0e50a48;p=thirdparty%2Fkea.git [354-compilation-with-mysql-fails-on-fedora-29] Fixed MySQL hook on MariaDB --- diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc index 38ab5c559f..0f44fcfcc5 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include #include #include #include @@ -67,10 +68,17 @@ MySqlConfigBackendImpl(const DatabaseConnection::ParameterMap& parameters) // caused issues for some unit tests which were unable to cleanup // the database after the test because of pending transactions. // Use of autocommit will eliminate this problem. +#ifdef HAVE_MYSQL_MY_BOOL my_bool result = mysql_autocommit(conn_.mysql_, 1); if (result != 0) { isc_throw(DbOperationError, mysql_error(conn_.mysql_)); } +#else + bool result = mysql_autocommit(conn_.mysql_, 1); + if (!result) { + isc_throw(DbOperationError, mysql_error(conn_.mysql_)); + } +#endif } MySqlConfigBackendImpl::~MySqlConfigBackendImpl() {