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