MySQL 8.0.30
Source Code Documentation
sql_alter_instance.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2022, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef SQL_ALTER_INSTANCE_INCLUDED
24#define SQL_ALTER_INSTANCE_INCLUDED
25
26#include <my_inttypes.h>
27
28class THD;
29/*
30 Base class for execution control for ALTER INSTANCE ... statement
31*/
33 protected:
35
36 public:
37 explicit Alter_instance(THD *thd) : m_thd(thd) {}
38 virtual bool execute() = 0;
39 bool log_to_binlog();
40 virtual ~Alter_instance() = default;
41};
42
44 public:
46
47 bool execute() override;
48 ~Rotate_innodb_master_key() override = default;
49};
50
52 public:
54
55 /**
56 Executes master key rotation by calling Rpl_encryption api.
57
58 @retval False on success
59 @retval True on error
60 */
61 bool execute() override;
62 ~Rotate_binlog_master_key() override = default;
63};
64
65/** Alter Innodb redo log properties. */
67 public:
68 /**
69 @param[in] thd server THD
70 @param[in] enable enable or disable redo logging
71 */
72 Innodb_redo_log(THD *thd, bool enable)
73 : Alter_instance(thd), m_enable(enable) {}
74
75 bool execute() override;
76
77 private:
78 /** Enable or disable redo logging. */
80};
81
83 public:
84 explicit Reload_keyring(THD *thd) : Alter_instance(thd) {}
85
86 /**
87 Execute keyring reload operation by calling required APIs
88
89 @returns status of the operation
90 @retval false Success
91 @retval true Error
92 */
93 bool execute() override;
94 virtual ~Reload_keyring() override = default;
95
96 private:
97 const static size_t s_error_message_length;
98};
99
100#endif /* SQL_ALTER_INSTANCE_INCLUDED */
Definition: sql_alter_instance.h:32
virtual bool execute()=0
THD * m_thd
Definition: sql_alter_instance.h:34
bool log_to_binlog()
Definition: sql_alter_instance.cc:60
virtual ~Alter_instance()=default
Alter_instance(THD *thd)
Definition: sql_alter_instance.h:37
Alter Innodb redo log properties.
Definition: sql_alter_instance.h:66
bool m_enable
Enable or disable redo logging.
Definition: sql_alter_instance.h:79
bool execute() override
Definition: sql_alter_instance.cc:156
Innodb_redo_log(THD *thd, bool enable)
Definition: sql_alter_instance.h:72
Definition: sql_alter_instance.h:82
bool execute() override
Execute keyring reload operation by calling required APIs.
Definition: sql_alter_instance.cc:229
static const size_t s_error_message_length
Definition: sql_alter_instance.h:97
virtual ~Reload_keyring() override=default
Reload_keyring(THD *thd)
Definition: sql_alter_instance.h:84
Definition: sql_alter_instance.h:51
bool execute() override
Executes master key rotation by calling Rpl_encryption api.
Definition: sql_alter_instance.cc:202
~Rotate_binlog_master_key() override=default
Rotate_binlog_master_key(THD *thd)
Definition: sql_alter_instance.h:53
Definition: sql_alter_instance.h:43
~Rotate_innodb_master_key() override=default
Rotate_innodb_master_key(THD *thd)
Definition: sql_alter_instance.h:45
bool execute() override
Definition: sql_alter_instance.cc:80
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
Some integer typedefs for easier portability.