Skip to content

Commit

Permalink
Allow building the MySQL driver with MariaDB libraries.
Browse files Browse the repository at this point in the history
Closes #505
  • Loading branch information
dveeden committed Jul 14, 2023
1 parent 2ca9e3f commit e17ce0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/drivers/mysql/drv_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)",
Expand Down

0 comments on commit e17ce0f

Please sign in to comment.