MySQL 9.0.0
Source Code Documentation
compression.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef COMPRESSION_INCLUDED
25#define COMPRESSION_INCLUDED
26
27/**
28 @file include/compression.h
29*/
30
31#include <sstream>
32#include <string>
33#include <vector>
34#include "my_inttypes.h"
35#include "mysql_com.h"
36
37#define COMPRESSION_ALGORITHM_ZLIB "zlib"
38#define COMPRESSION_ALGORITHM_ZSTD "zstd"
39#define COMPRESSION_ALGORITHM_UNCOMPRESSED "uncompressed"
40#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX 32
41#define COMPRESSION_ALGORITHM_COUNT_MAX 3
42#define COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE \
43 ((COMPRESSION_ALGORITHM_NAME_LENGTH_MAX * COMPRESSION_ALGORITHM_COUNT_MAX) + \
44 3)
45#define PROTOCOL_COMPRESSION_DEFAULT_VALUE "zlib,zstd,uncompressed"
46
48
49/* Helper functions to validate compression algorithm and level */
51 std::string name = std::string());
54 std::vector<std::string> &list);
55bool is_zstd_compression_level_valid(uint level);
56bool validate_compression_attributes(std::string algorithm_names,
57 std::string channel_name,
58 bool ignore_errors);
59
60#endif /* COMPRESSION_INCLUDED */
void parse_compression_algorithms_list(std::string name, std::vector< std::string > &list)
This function is used to parse comma separated list of compression algorithm names and return a list ...
Definition: compression.cc:62
constexpr int default_zstd_compression_level
Definition: compression.h:47
bool validate_compression_attributes(std::string algorithm_names, std::string channel_name, bool ignore_errors)
This function is used to validate compression algorithm names and maximum names is not more than 3.
Definition: compression.cc:93
enum_compression_algorithm get_compression_algorithm(std::string name=std::string())
This function is used to validate compression algorithm specified as part of change replication sourc...
Definition: compression.cc:40
std::string get_compression_algorithm_name(enum_compression_algorithm)
bool is_zstd_compression_level_valid(uint level)
This function is used to validate compression level for zstd compression.
Definition: compression.cc:77
enum_compression_algorithm
Definition: my_compress.h:28
Some integer typedefs for easier portability.
Common definition between mysql server & client.
static bool ignore_errors
Definition: mysqlcheck.cc:62
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2879
case opt name
Definition: sslopt-case.h:29