aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-03-30 22:42:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-04-05 17:18:12 +0300
commitd16e6dfde2a75c55604cabeddb2dbc90dd951550 (patch)
tree1bd0fb1d339e860580cb579aff434f8a08d33c38
parent3d384661091ba33ad4745cc7df4986336fb03b6a (diff)
Add support for building against libmysqlclient 8.0
-rw-r--r--odb/mysql/mysql-types.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/mysql/mysql-types.hxx b/odb/mysql/mysql-types.hxx
index b4ec44a..32cb332 100644
--- a/odb/mysql/mysql-types.hxx
+++ b/odb/mysql/mysql-types.hxx
@@ -7,8 +7,22 @@
#include <odb/mysql/details/config.hxx>
+#include <odb/mysql/version.hxx>
+
+// Starting with 8.0.1 instead of my_bool MySQL uses bool directly. We keep
+// using the alias for compatibility with previous versions.
+//
+#if !defined(LIBODB_MYSQL_MARIADB) && MYSQL_VERSION_ID >= 80001
+typedef bool my_bool;
+#else
typedef char my_bool;
+#endif
+
+// Starting with 8.0.11 MySQL renamed st_mysql_bind to MYSQL_BIND.
+//
+#if defined(LIBODB_MYSQL_MARIADB) || MYSQL_VERSION_ID < 80011
typedef struct st_mysql_bind MYSQL_BIND;
+#endif
// MariaDB defines time types directly in mysql.h. Note that MariaDB is only
// supported by the build2 build so we include the header as <mysql/mysql.h>