MySQL 8.3.0
Source Code Documentation
compression.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef COMPRESSION_INCLUDED
24#define COMPRESSION_INCLUDED
25
26/**
27 @file include/compression.h
28*/
29
30#include <sstream>
31#include <string>
32#include <vector>
33#include "my_inttypes.h"
34#include "mysql_com.h"
35
36#define COMPRESSION_ALGORITHM_ZLIB "zlib"
37#define COMPRESSION_ALGORITHM_ZSTD "zstd"
38#define COMPRESSION_ALGORITHM_UNCOMPRESSED "uncompressed"
39#define COMPRESSION_ALGORITHM_NAME_LENGTH_MAX 32
40#define COMPRESSION_ALGORITHM_COUNT_MAX 3
41#define COMPRESSION_ALGORITHM_NAME_BUFFER_SIZE \
42 ((COMPRESSION_ALGORITHM_NAME_LENGTH_MAX * COMPRESSION_ALGORITHM_COUNT_MAX) + \
43 3)
44#define PROTOCOL_COMPRESSION_DEFAULT_VALUE "zlib,zstd,uncompressed"
45
47
48/* Helper functions to validate compression algorithm and level */
50 std::string name = std::string());
53 std::vector<std::string> &list);
54bool is_zstd_compression_level_valid(uint level);
55bool validate_compression_attributes(std::string algorithm_names,
56 std::string channel_name,
57 bool ignore_errors);
58
59#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:61
constexpr int default_zstd_compression_level
Definition: compression.h:46
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:92
enum_compression_algorithm get_compression_algorithm(std::string name=std::string())
This function is used to validate compression algorithm specified as part of change master to stateme...
Definition: compression.cc:39
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:76
enum_compression_algorithm
Definition: my_compress.h:27
Some integer typedefs for easier portability.
Common definition between mysql server & client.
static bool ignore_errors
Definition: mysqlcheck.cc:61
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2877
case opt name
Definition: sslopt-case.h:32