]> 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:31:08 +0000 (07:31 -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 3f67dd5ca7371c206c6db5a27b55ba2040a40936..9336f3f5e97fc55dbceecbf2b92552eb190463f0 100644 (file)
@@ -173,7 +173,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
 
@@ -468,7 +470,9 @@ static int my_connect_db(struct ast_config *cfg)
        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