Module: kamailio
Branch: master
Commit: 5b2be5e2c716ad8f8502b3be3db5194eb8474d39
URL:
https://github.com/kamailio/kamailio/commit/5b2be5e2c716ad8f8502b3be3db5194…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-07-09T10:38:44+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/5b2be5e2c716ad8f8502b3be3db5194…
Patch:
https://github.com/kamailio/kamailio/commit/5b2be5e2c716ad8f8502b3be3db5194…
---
diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 240d3f59a76..21ac5023c81 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -179,15 +179,15 @@ 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 %s:%d) - "
"ignoring\n",
- db_mysql_opt_ssl_ca);
-#endif /* MYSQL_OPT_SSL_CA */
+ MYSQL_SERVER_VERSION, MYSQL_VERSION_ID);
+#endif /* MYSQL_VERSION_ID */
#ifdef KSR_MYSQL_OPT_RECONNECT
/* set reconnect flag if enabled */