[CONC-575] Support for (MySQL) zstd compression Created: 2022-01-13  Updated: 2022-01-25  Resolved: 2022-01-25

Status: Closed
Project: MariaDB Connector/C
Component/s: Protocol
Affects Version/s: None
Fix Version/s: 3.3.0

Type: Task Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

ZStandard compression was added in MySQL 8.0 but is currently not supported by MariaDB Connector/C.

MySQL indicates ZStandard compression support by setting CLIENT_ZSTD_COMPRESSION flag (1UL << 26).

For using ZStandard compression the client set's CLIENT_ZSTD_COMPRESSION flag, instead of CLIENT_COMPRESS (=zlib compression) flag.
In addition to the capability flag, the client will send a 4 byte (unsigned integer) after connection attributes which specifies the compress level:

Client Handshake Response:

...
if (server_capabilities & CLIENT_CONNECT_ATTRS)
    int<lenenc> size of connection attributes
    while packet has remaining data
        string<lenenc> key
        string<lenenc> value
*NEW* 
if (server_capabilities & CLIENT_ZSTD_COMPRESSION)
    int<4> compression level


Generated at Thu Feb 08 03:06:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.