From e17ce0fa5970dacaa347c9613b1306014fc18c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 14 Jul 2023 14:27:03 +0200 Subject: [PATCH] Allow building the MySQL driver with MariaDB libraries. Closes #505 --- src/drivers/mysql/drv_mysql.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/mysql/drv_mysql.c b/src/drivers/mysql/drv_mysql.c index 5e9afba..260e99d 100644 --- a/src/drivers/mysql/drv_mysql.c +++ b/src/drivers/mysql/drv_mysql.c @@ -109,7 +109,9 @@ typedef struct const char *ssl_ca; const char *ssl_cipher; unsigned char use_compression; +#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS const char *compression_alg; +#endif unsigned char debug; sb_list_t *ignored_errors; unsigned int dry_run; @@ -337,7 +339,9 @@ int mysql_drv_init(void) #endif args.use_compression = sb_get_value_flag("mysql-compression"); +#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS args.compression_alg = sb_get_value_string("mysql-compression-algorithms"); +#endif args.debug = sb_get_value_flag("mysql-debug"); if (args.debug) @@ -416,8 +420,10 @@ static int mysql_drv_real_connect(db_mysql_conn_t *db_mysql_con) DEBUG("mysql_options(%p, %s, %s)",con, "MYSQL_OPT_COMPRESS", "NULL"); mysql_options(con, MYSQL_OPT_COMPRESS, NULL); +#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS DEBUG("mysql_options(%p, %s, %s)",con, "MYSQL_OPT_COMPRESSION_ALGORITHMS", args.compression_alg); mysql_options(con, MYSQL_OPT_COMPRESSION_ALGORITHMS, args.compression_alg); +#endif } DEBUG("mysql_real_connect(%p, \"%s\", \"%s\", \"%s\", \"%s\", %u, \"%s\", %s)",