![]() |
MySQL 8.0.43
Source Code Documentation
|
#include "my_compress.h"#include <string.h>#include <sys/types.h>#include <zlib.h>#include <zstd.h>#include <algorithm>#include <cstddef>#include <mysql_com.h>#include "my_compiler.h"#include "my_dbug.h"#include "my_inttypes.h"#include "my_sys.h"#include "mysql/service_mysql_alloc.h"#include "mysys/mysys_priv.h"Functions | |
| void | mysql_compress_context_init (mysql_compress_context *cmp_ctx, enum enum_compression_algorithm algorithm, unsigned int compression_level) |
| Initialize a compress context object to be associated with a NET object. More... | |
| void | mysql_compress_context_deinit (mysql_compress_context *mysql_compress_ctx) |
| Deinitialize the compression context allocated. More... | |
| uchar * | zstd_compress_alloc (mysql_zstd_compress_context *comp_ctx, const uchar *packet, size_t *len, size_t *complen) |
| Allocate zstd compression contexts if necessary and compress using zstd the buffer. More... | |
| static bool | zstd_uncompress (mysql_zstd_compress_context *comp_ctx, uchar *packet, size_t len, size_t *complen) |
| Uncompress a zstd compressed data. More... | |
| static uchar * | zlib_compress_alloc (mysql_zlib_compress_context *comp_ctx, const uchar *packet, size_t *len, size_t *complen) |
| Allocate zlib compression contexts if necessary and compress using zlib the buffer. More... | |
| static bool | zlib_uncompress (uchar *packet, size_t len, size_t *complen) |
| Uncompress a zlib compressed data. More... | |
| bool | my_compress (mysql_compress_context *comp_ctx, uchar *packet, size_t *len, size_t *complen) |
| This replaces the packet with a compressed packet. More... | |
| uchar * | my_compress_alloc (mysql_compress_context *comp_ctx, const uchar *packet, size_t *len, size_t *complen) |
| bool | my_uncompress (mysql_compress_context *comp_ctx, uchar *packet, size_t len, size_t *complen) |
| Uncompress packet. More... | |
| unsigned int | mysql_default_compression_level (enum enum_compression_algorithm algorithm) |
| Get default compression level corresponding to a given compression method. More... | |
| void mysql_compress_context_deinit | ( | mysql_compress_context * | mysql_compress_ctx | ) |
Deinitialize the compression context allocated.
| mysql_compress_ctx | Pointer to Compression context. |
| void mysql_compress_context_init | ( | mysql_compress_context * | cmp_ctx, |
| enum enum_compression_algorithm | algorithm, | ||
| unsigned int | compression_level | ||
| ) |
Initialize a compress context object to be associated with a NET object.
| cmp_ctx | Pointer to compression context. |
| algorithm | Compression algorithm. |
| compression_level | Compression level corresponding to the compression algorithm. |
| unsigned int mysql_default_compression_level | ( | enum enum_compression_algorithm | algorithm | ) |
Get default compression level corresponding to a given compression method.
| algorithm | Compression Method. Possible values are zlib or zstd. |
|
static |
Allocate zlib compression contexts if necessary and compress using zlib the buffer.
| comp_ctx | Compression context info relating to zlib. | |
| packet | Data to compress. This is is replaced with the compressed data. | |
| len | Length of data to compress at 'packet' | |
| [out] | complen | 0 if packet was not compressed |
|
static |
Uncompress a zlib compressed data.
| packet | Packet which zstd compressed data. | |
| len | Length of zstd compressed packet. | |
| [out] | complen | Length of uncompressed packet. |
| uchar * zstd_compress_alloc | ( | mysql_zstd_compress_context * | comp_ctx, |
| const uchar * | packet, | ||
| size_t * | len, | ||
| size_t * | complen | ||
| ) |
Allocate zstd compression contexts if necessary and compress using zstd the buffer.
| comp_ctx | Compression context info relating to zstd. |
| packet | Data to compress. This is is replaced with the compressed data. |
| len | Length of data to compress at 'packet' |
| complen | out: 0 if packet was not compressed |
|
static |
Uncompress a zstd compressed data.
| comp_ctx | Pointer to compression context. | |
| packet | Packet with zstd compressed data. | |
| len | Length of zstd compressed packet. | |
| [out] | complen | Length of uncompressed packet. |