MySQL 26.7.0
Source Code Documentation
server_version_transition.h
Go to the documentation of this file.
1/* Copyright (c) 2026, 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 DD__BOOTSTRAP__SERVER_VERSION_TRANSITION_INCLUDED
25#define DD__BOOTSTRAP__SERVER_VERSION_TRANSITION_INCLUDED
26
27#include "my_sys.h" // My_server_version
28
29namespace dd::bootstrap {
30
31/**
32 Decide whether a stored server version may move to a target server version.
33
34 This class is intentionally independent of DD_properties and THD. Tests can
35 construct it directly from persisted source-version details and target
36 metadata, inspect the pure Result from evaluate(), and leave error-log
37 side-effects to check_and_report().
38*/
40 public:
41 enum class Result {
49 };
50
52
53 Result evaluate() const;
54
55 /**
56 Emit the matching error-log message if evaluate() rejects the transition.
57
58 @retval false Transition accepted.
59 @retval true Transition rejected and error reported.
60 */
61 bool check_and_report() const;
62
63 private:
66};
67
68} // namespace dd::bootstrap
69
70#endif // DD__BOOTSTRAP__SERVER_VERSION_TRANSITION_INCLUDED
Decide whether a stored server version may move to a target server version.
Definition: server_version_transition.h:39
bool check_and_report() const
Emit the matching error-log message if evaluate() rejects the transition.
Definition: server_version_transition.cc:231
Result
Definition: server_version_transition.h:41
Server_version_transition(My_server_version source, My_server_version target)
Definition: server_version_transition.cc:34
My_server_version m_target
Definition: server_version_transition.h:65
My_server_version m_source
Definition: server_version_transition.h:64
Result evaluate() const
Definition: server_version_transition.cc:53
Common header for many mysys elements.
Definition: bootstrap_ctx.cc:27
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
Definition: my_server_version.h:29