Merge pull request #506 from dveeden/mysql__compression_alg__mariadb

Allow building the MySQL driver with MariaDB libraries.
This commit is contained in:
Alexey Kopytov
2024-07-28 19:22:27 +03:00
committed by GitHub
3 changed files with 32 additions and 2 deletions

View File

@ -24,3 +24,28 @@ jobs:
- name: Test
run: make test
build_mariadb:
runs-on: ubuntu-22.04
name: Build with MariaDB
steps:
- name: Setup MariaDB Repo
run: |
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64] https://ftp.nluug.nl/db/mariadb/repo/11.0/ubuntu jammy main'
- name: Setup MariaDB Libs
run: sudo apt install libmariadb-dev libmariadb-dev-compat
- name: Checkout
uses: actions/checkout@v3
- name: Autogen
run: ./autogen.sh
- name: Configure
run: ./configure --with-mysql --with-pgsql
- name: Build
run: make
- name: MariaDB version
run: mariadb_config --version
- name: Sysbench version
run: ./src/sysbench --version
- name: Test
run: make test

View File

@ -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)",

View File

@ -8,7 +8,7 @@ Skip test if the MySQL driver is not available.
$ sysbench --help | grep -- '--db-driver'
--db-driver=STRING specifies database driver to use ('help' to get list of available drivers) [mysql]
$ sysbench --help | sed -n '/mysql options:/,/^$/p'
$ sysbench --help | sed -n '/mysql options:/,/^$/p' | grep -v 'mysql-ssl[=\[]'
mysql options:
--mysql-host=[LIST,...] MySQL server host [localhost]
--mysql-port=[LIST,...] MySQL server port [3306]
@ -16,7 +16,6 @@ Skip test if the MySQL driver is not available.
--mysql-user=STRING MySQL user [sbtest]
--mysql-password=STRING MySQL password []
--mysql-db=STRING MySQL database name [sbtest]
--mysql-ssl=STRING SSL mode. This accepts the same values as the --ssl-mode option in the MySQL client utilities. Disabled by default [disabled]
--mysql-ssl-key=STRING path name of the client private key file
--mysql-ssl-ca=STRING path name of the CA file
--mysql-ssl-cert=STRING path name of the client public key certificate file