Module: kamailio
Branch: 5.1
Commit: e8f479817140b32429d52cb25e89dff5dac86e22
URL: 
https://github.com/kamailio/kamailio/commit/e8f479817140b32429d52cb25e89dff5dac86e22

Author: Henning Westerholt <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2018-08-15T21:22:46+02:00

db_mysql: improved fix in commit 1736723cc2a15 - it did not worked for mariadb

- improved fix in commit 1736723cc2a15 - it did not worked for mariadb
- Reason is that MariaDB increased its numbering scheme, they are now at 10.x
- MariaDB 10 is still using my_bool type, added few more #ifs to fix this

(cherry picked from commit 9f459dccf84be7d7d0fbce89ca9165f7d1c4d66b)

---

Modified: src/modules/db_mysql/km_my_con.c
Modified: src/modules/db_mysql/my_fld.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/e8f479817140b32429d52cb25e89dff5dac86e22.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e8f479817140b32429d52cb25e89dff5dac86e22.patch

---

diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 242329e295..9d6566204d 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -29,7 +29,12 @@
 #include "km_my_con.h"
 #include "km_db_mysql.h"
 #include <mysql.h>
+
+/* MariaDB exports MYSQL_VERSION_ID as well, but changed numbering scheme */
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
 #include <stdbool.h>
+#endif
+
 #include "../../core/mem/mem.h"
 #include "../../core/dprint.h"
 #include "../../core/ut.h"
@@ -45,7 +50,11 @@ struct my_con* db_mysql_new_connection(const struct db_id* 
id)
        char *host, *grp, *egrp;
        unsigned int connection_flag = 0;
 #if MYSQL_VERSION_ID > 50012
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
        bool rec;
+#else
+        my_bool rec;
+#endif
 #endif
 
        if (!id) {
diff --git a/src/modules/db_mysql/my_fld.h b/src/modules/db_mysql/my_fld.h
index 539a4df699..c247e48407 100644
--- a/src/modules/db_mysql/my_fld.h
+++ b/src/modules/db_mysql/my_fld.h
@@ -29,13 +29,21 @@
 #include "../../lib/srdb2/db_drv.h"
 #include "../../lib/srdb2/db_fld.h"
 #include <mysql.h>
+
+/* MariaDB exports MYSQL_VERSION_ID as well, but changed numbering */
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
 #include <stdbool.h>
+#endif
 
 struct my_fld {
        db_drv_t gen;
 
        char* name;
+#if MYSQL_VERSION_ID > 80000 && ! defined MARIADB_BASE_VERSION
        bool is_null;
+#else
+       my_bool is_null;
+#endif
        MYSQL_TIME time;
        unsigned long length;
        str buf;


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to