]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Typedef my_bool if missing.
authorMark Andrews <marka@isc.org>
Mon, 16 Mar 2020 05:44:51 +0000 (16:44 +1100)
committerMark Andrews <marka@isc.org>
Thu, 26 Mar 2020 20:36:43 +0000 (20:36 +0000)
ORACLE MySQL 8.0 has dropped the my_bool type, so we need to reinstate
it back when compiling with that version or higher.  MariaDB is still
keeping the my_bool type.  The numbering between the two (MariaDB 5.x
jumped to MariaDB 10.x) doesn't make the life of the developer easy.

contrib/dlz/drivers/dlz_mysql_driver.c
contrib/dlz/modules/mysql/dlz_mysql_dynamic.c
contrib/dlz/modules/mysqldyn/dlz_mysqldyn_mod.c

index f000aab8bdb5b719d8331f76235ad078a2f4cc07..afe906a7fb1bffd596ce9e0324836caa48a3f275 100644 (file)
 #include <dlz/sdlz_helper.h>
 #include <named/globals.h>
 
+#if !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000
+typedef bool my_bool;
+#endif /* !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000 */
+
 static dns_sdlzimplementation_t *dlz_mysql = NULL;
 
 #define dbc_search_limit 30
index 1a40112b79433f3dbe09b40438e587225f05171c..de6beac7362f07311b28b0bc60948c862ccc3789 100644 (file)
 #include <dlz_minimal.h>
 #include <dlz_pthread.h>
 
+#if !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000
+typedef bool my_bool;
+#endif /* !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000 */
+
 #define dbc_search_limit 30
 #define ALLNODES        1
 #define ALLOWXFR        2
index 9a2ca2370fbd2026feb95364197c887631c083c7..d6f759d4145fd3133bae6289b4f2e29804828530 100644 (file)
 #include <dlz_minimal.h>
 #include <dlz_pthread.h>
 
+#if !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000
+typedef bool my_bool;
+#endif /* !defined(LIBMARIADB) && MYSQL_VERSION_ID >= 80000 */
+
 /*
  * The SQL queries that will be used for lookups and updates are defined
  * here.  They will be processed into queries by the build_query()
@@ -1020,7 +1024,10 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
         */
        if (mysql_thread_safe()) {
                for (n = 0; n < MAX_DBI; n++) {
+#if MYSQL_VERSION_ID >= 50000
                        my_bool opt = 1;
+#endif
+
                        dlz_mutex_init(&state->db[n].mutex, NULL);
                        dlz_mutex_lock(&state->db[n].mutex);
                        state->db[n].id = n;
@@ -1028,8 +1035,10 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
                        state->db[n].sock = mysql_init(NULL);
                        mysql_options(state->db[n].sock,
                                      MYSQL_READ_DEFAULT_GROUP, modname);
+#if MYSQL_VERSION_ID >= 50000
                        mysql_options(state->db[n].sock, MYSQL_OPT_RECONNECT,
                                      &opt);
+#endif
                        dlz_mutex_unlock(&state->db[n].mutex);
                }