Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_mysql: failed build on CentOS 7 #3809

Open
sergey-safarov opened this issue Apr 10, 2024 · 4 comments
Open

db_mysql: failed build on CentOS 7 #3809

sergey-safarov opened this issue Apr 10, 2024 · 4 comments

Comments

@sergey-safarov
Copy link
Member

Description

I can see this error during db_mysql compilation on CentOS 7

CC (gcc) [M db_mysql.so]             km_dbase.o
CC (gcc) [M db_mysql.so]             km_val.o
CC (gcc) [M db_mysql.so]             km_row.o
CC (gcc) [M db_mysql.so]             km_my_con.o
km_my_con.c: In function 'db_mysql_new_connection':
km_my_con.c:183:15: error: 'MYSQL_OPT_SSL_CA' undeclared (first use in this function)
     ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
               ^
km_my_con.c:183:15: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [km_my_con.o] Error 1
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/kamailio-5.8.1/src'
make: *** [every-module] Error 2

This for 5.8.1 release.

@sergey-safarov
Copy link
Member Author

This is related to commit ea81e6c
@space88man could you look.

@space88man
Copy link
Contributor

space88man commented Apr 11, 2024

For 5.8 and future is Kamailio still supporting CentOS 7 ?

CentOS 7 will be EoL, 30 June 2024 - not just EoL in terms of no more package updates, but it will be physically removed from all the CentOS mirrors.

MariaDB 5.5 is also EoL: a workaround is to recommend use of newer MariaDB-devel from MariaDB itself. MariaDB is still distributing 10.x/11.x packages for rhel 7 and centos 7.

@sergey-safarov
Copy link
Member Author

I am fine with all of these cases:

  1. add #ifdef for SSL support into db_mysql;
  2. drop CentOS 7 support;
  3. build db_mysql module with MariaDB devel packages.

@miconda @linuxmaniac @henningw what is your opinion?

@sergey-safarov
Copy link
Member Author

sergey-safarov commented Apr 11, 2024

How about this change

diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 4c756db..c625dfa 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/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 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants