]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cdr_mysql: Fix missing use of 'my_bool' with MySql >= 8.0.1
authorGeorge Joseph <gjoseph@digium.com>
Tue, 29 Oct 2019 13:35:10 +0000 (07:35 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Thu, 7 Nov 2019 13:30:36 +0000 (07:30 -0600)
MySql 8.0.1 replaced the "my_bool" type with "bool" so an #if
was added to use "bool" with MYSQL_VERSION_ID >= 80001.

ASTERISK-28604

Change-Id: I66a28d8f0011e33774edee13a6f8efd2302bb920

addons/cdr_mysql.c

index 7fb0b6ee7c0fbb16996c11de018689b0027771bd..b613844f8f63dcaae7f63a7f8c665946cabbd9d7 100644 (file)
@@ -180,7 +180,9 @@ static int mysql_log(struct ast_cdr *cdr)
 {
        struct ast_str *sql1 = ast_str_thread_get(&sql1_buf, 1024), *sql2 = ast_str_thread_get(&sql2_buf, 1024);
        int retries = 5;
-#if MYSQL_VERSION_ID >= 50013
+#if MYSQL_VERSION_ID >= 80001
+       bool my_bool_true = 1;
+#elif MYSQL_VERSION_ID >= 50013
        my_bool my_bool_true = 1;
 #endif
 
@@ -478,7 +480,9 @@ static int my_load_module(int reload)
        MYSQL_ROW row;
        MYSQL_RES *result;
        char sqldesc[128];
-#if MYSQL_VERSION_ID >= 50013
+#if MYSQL_VERSION_ID >= 80001
+       bool my_bool_true = 1;
+#elif MYSQL_VERSION_ID >= 50013
        my_bool my_bool_true = 1;
 #endif