Module: kamailio
Branch: master
Commit: 92cfedaaffb034db536f3bcf68695b433db92706
URL:
https://github.com/kamailio/kamailio/commit/92cfedaaffb034db536f3bcf68695b4…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-07-09T10:53:07+08:00
db_mysql: fix check for enum MYSQL_OPT_SSL_CA for CentOS 7/5.5.x
- MYSQL_OPT_SSL_CA is an enum not a macro
- base check on MYSQL_VERSION_ID - 50568 used in CentOS 7
Addresses #3910
---
Modified: src/modules/db_mysql/km_my_con.c
---
Diff:
https://github.com/kamailio/kamailio/commit/92cfedaaffb034db536f3bcf68695b4…
Patch:
https://github.com/kamailio/kamailio/commit/92cfedaaffb034db536f3bcf68695b4…
---
diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 240d3f59a76..37508ce24c0 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -179,14 +179,14 @@ struct my_con *db_mysql_new_connection(const struct db_id *id)
#endif /* MYSQL_VERSION_ID */
#endif /* MARIADB_BASE_VERSION */
-#ifdef MYSQL_OPT_SSL_CA
+#if(MYSQL_VERSION_ID >= 50600)
if(db_mysql_opt_ssl_ca)
mysql_options(
ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
#else
- LM_DBG("opt_ssl_ca option not supported by mysql version (value %s) - "
+ LM_DBG("opt_ssl_ca option not supported by mysql version (value %d) - "
"ignoring\n",
- db_mysql_opt_ssl_ca);
+ MYSQL_VERSION_ID);
#endif /* MYSQL_OPT_SSL_CA */
#ifdef KSR_MYSQL_OPT_RECONNECT