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