Skip to content

Commit e17ce0f

Browse files
committed
Allow building the MySQL driver with MariaDB libraries.
Closes #505
1 parent 2ca9e3f commit e17ce0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/drivers/mysql/drv_mysql.c

+6
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ typedef struct
109109
const char *ssl_ca;
110110
const char *ssl_cipher;
111111
unsigned char use_compression;
112+
#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS
112113
const char *compression_alg;
114+
#endif
113115
unsigned char debug;
114116
sb_list_t *ignored_errors;
115117
unsigned int dry_run;
@@ -337,7 +339,9 @@ int mysql_drv_init(void)
337339
#endif
338340

339341
args.use_compression = sb_get_value_flag("mysql-compression");
342+
#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS
340343
args.compression_alg = sb_get_value_string("mysql-compression-algorithms");
344+
#endif
341345

342346
args.debug = sb_get_value_flag("mysql-debug");
343347
if (args.debug)
@@ -416,8 +420,10 @@ static int mysql_drv_real_connect(db_mysql_conn_t *db_mysql_con)
416420
DEBUG("mysql_options(%p, %s, %s)",con, "MYSQL_OPT_COMPRESS", "NULL");
417421
mysql_options(con, MYSQL_OPT_COMPRESS, NULL);
418422

423+
#ifdef MYSQL_OPT_COMPRESSION_ALGORITHMS
419424
DEBUG("mysql_options(%p, %s, %s)",con, "MYSQL_OPT_COMPRESSION_ALGORITHMS", args.compression_alg);
420425
mysql_options(con, MYSQL_OPT_COMPRESSION_ALGORITHMS, args.compression_alg);
426+
#endif
421427
}
422428

423429
DEBUG("mysql_real_connect(%p, \"%s\", \"%s\", \"%s\", \"%s\", %u, \"%s\", %s)",

0 commit comments

Comments
 (0)