Parcourir la source

db_mysql: fixed build on CentOS 7

Sergey Safarov il y a 1 an
Parent
commit
767b3faee3
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      src/modules/db_mysql/km_my_con.c

+ 7 - 0
src/modules/db_mysql/km_my_con.c

@@ -178,9 +178,16 @@ 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(db_mysql_opt_ssl_ca)
 		mysql_options(
 				ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
+#else
+	LM_WARN("opt_ssl_ca option not supported by mysql version (value %s) - "
+			"ignoring\n",
+			db_mysql_opt_ssl_ca);
+#endif /* MYSQL_OPT_SSL_CA */
 
 #ifdef KSR_MYSQL_OPT_RECONNECT
 	/* set reconnect flag if enabled */