1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +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

@@ -3844,7 +3844,7 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
}
break;
case MYSQL_OPT_ZSTD_COMPRESSION_LEVEL:
OPT_SET_EXTENDED_VALUE_INT(&mysql->options, zstd_compression_level, *((unsigned int *)arg1));
OPT_SET_EXTENDED_VALUE(&mysql->options, zstd_compression_level, *((unsigned char *)arg1));
break;
default:
va_end(ap);
@@ -3872,6 +3872,9 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
case MYSQL_OPT_COMPRESS:
*((my_bool *)arg)= mysql->options.compress;
break;
case MYSQL_OPT_ZSTD_COMPRESSION_LEVEL:
*((unsigned char *)arg)= mysql->options.extension->zstd_compression_level;
break;
case MYSQL_OPT_NAMED_PIPE:
*((my_bool *)arg)= mysql->options.named_pipe;
break;