1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

MYSQL_OPT_ZSTD_COMPRESSION_LEVEL fixes:

Follow up for commit e633858c9e:
- Fixed ASAN bug (int to char conversion)
- Allow to retrieve zstd compression level via mysql_get_optionv()
This commit is contained in:
Georg Richter
2024-12-10 05:18:08 +01:00
parent e633858c9e
commit 16e5b88bab
3 changed files with 21 additions and 2 deletions

View File

@@ -1663,7 +1663,23 @@ static int test_ext_field_attr(MYSQL *mysql)
return OK;
}
static int test_comp_level(MYSQL *my __attribute__((unused)))
{
unsigned char clevel= 5;
unsigned char clevel1= 0;
MYSQL *mysql= mysql_init(NULL);
mysql_optionsv(mysql, MYSQL_OPT_ZSTD_COMPRESSION_LEVEL, &clevel);
mysql_get_optionv(mysql, MYSQL_OPT_ZSTD_COMPRESSION_LEVEL, &clevel1);
FAIL_IF(clevel != clevel1, "Different compression levels");
mysql_close(mysql);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_comp_level", test_comp_level, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_ext_field_attr", test_ext_field_attr, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc533", test_conc533, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc163", test_conc163, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},