MySQL 8.0.39
Source Code Documentation
mysql_version_gcs_protocol_map.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 MYSQL_VERSION_GCS_PROTOCOL_MAP_INCLUDE
25#define MYSQL_VERSION_GCS_PROTOCOL_MAP_INCLUDE
26
29
30/**
31 * Specific Member versions.
32 *
33 * Add here specific versions that you want to use in the code to do
34 * comparisons.
35 */
36
37/**
38 * @brief First member version where we have XCom's single leader
39 */
40#define FIRST_PROTOCOL_WITH_SUPPORT_FOR_CONSENSUS_LEADERS 0x080027
41
42/**
43 * Converts the given GCS protocol version into the respective MySQL version.
44 *
45 * @param gcs_protocol The GCS protocol to convert
46 * @returns the respective MySQL version as a Member_version object
47 */
49 Gcs_protocol_version const &gcs_protocol);
50
51/** Maps GCS protocol version to MySQL version. */
52/**
53 * Converts the @c mysql_version into the respective GCS protocol, taking into
54 * account this server's version @c my_version.
55 *
56 * @param mysql_version The MySQL version to convert
57 * @param my_version The MySQL version of this server
58 * @returns the respective GCS protocol version
59 */
61 Member_version const &mysql_version, Member_version const &my_version);
62
63/**
64 * Checks whether the given C-style string has the version format
65 * "major.minor.patch".
66 *
67 * @param version_str the string to validate
68 * @retval true if valid
69 * @retval false otherwise
70 */
71bool valid_mysql_version_string(char const *version_str);
72
73/**
74 * Converts a "major.minor.patch" C-style string to a Member_version object.
75 *
76 * Requires that version_str is a valid_mysql_version_string.
77 *
78 * @param version_str the string to convert
79 * @returns the version string as a Member_version object
80 */
81Member_version convert_to_member_version(char const *version_str);
82
83#endif /* MYSQL_VERSION_GCS_PROTOCOL_MAP_INCLUDE */
represent the MySQL version of a Member within the Group Replication group.
Definition: member_version.h:35
Gcs_protocol_version
The GCS protocol versions.
Definition: gcs_types.h:128
Member_version convert_to_member_version(char const *version_str)
Converts a "major.minor.patch" C-style string to a Member_version object.
Definition: mysql_version_gcs_protocol_map.cc:135
Member_version convert_to_mysql_version(Gcs_protocol_version const &gcs_protocol)
Converts the given GCS protocol version into the respective MySQL version.
Definition: mysql_version_gcs_protocol_map.cc:53
bool valid_mysql_version_string(char const *version_str)
Checks whether the given C-style string has the version format "major.minor.patch".
Definition: mysql_version_gcs_protocol_map.cc:102
Gcs_protocol_version convert_to_gcs_protocol(Member_version const &mysql_version, Member_version const &my_version)
Maps GCS protocol version to MySQL version.
Definition: mysql_version_gcs_protocol_map.cc:80