]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[354-compilation-with-mysql-fails-on-fedora-29] Fixed MySQL hook on MariaDB
authorFrancis Dupont <fdupont@isc.org>
Sat, 2 Feb 2019 03:29:41 +0000 (04:29 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 7 Feb 2019 22:02:22 +0000 (17:02 -0500)
src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc

index 38ab5c559f03c30dc1ceb2f5ad4ab9993e18ce92..0f44fcfcc5af3e408e62f2f10674993ffd7cd22c 100644 (file)
@@ -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 <config.h>
 #include <mysql_cb_impl.h>
 #include <asiolink/io_address.h>
 #include <config_backend/constants.h>
@@ -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() {