MySQL  8.0.19
Source Code Documentation
sql_alter_instance.h
Go to the documentation of this file.
1 /* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
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 SQL_ALTER_INSTANCE_INCLUDED
24 #define SQL_ALTER_INSTANCE_INCLUDED
25 
26 class THD;
27 /*
28  Base class for execution control for ALTER INSTANCE ... statement
29 */
31  protected:
33 
34  public:
35  explicit Alter_instance(THD *thd) : m_thd(thd) {}
36  virtual bool execute() = 0;
37  bool log_to_binlog();
38  virtual ~Alter_instance() {}
39 };
40 
42  public:
43  explicit Rotate_innodb_master_key(THD *thd) : Alter_instance(thd) {}
44 
45  bool execute();
47 };
48 
50  public:
51  explicit Rotate_binlog_master_key(THD *thd) : Alter_instance(thd) {}
52 
53  /**
54  Executes master key rotation by calling Rpl_encryption api.
55 
56  @retval False on success
57  @retval True on error
58  */
59  bool execute();
60  virtual ~Rotate_binlog_master_key() = default;
61 };
62 
63 #endif /* SQL_ALTER_INSTANCE_INCLUDED */
Rotate_binlog_master_key::Rotate_binlog_master_key
Rotate_binlog_master_key(THD *thd)
Definition: sql_alter_instance.h:51
Rotate_binlog_master_key::~Rotate_binlog_master_key
virtual ~Rotate_binlog_master_key()=default
THD
Definition: sql_class.h:764
Rotate_innodb_master_key::~Rotate_innodb_master_key
~Rotate_innodb_master_key()
Definition: sql_alter_instance.h:46
Rotate_binlog_master_key::execute
bool execute()
Executes master key rotation by calling Rpl_encryption api.
Definition: sql_alter_instance.cc:141
Alter_instance::m_thd
THD * m_thd
Definition: sql_alter_instance.h:32
Alter_instance::execute
virtual bool execute()=0
Rotate_innodb_master_key
Definition: sql_alter_instance.h:41
Alter_instance::log_to_binlog
bool log_to_binlog()
Definition: sql_alter_instance.cc:57
Alter_instance
Definition: sql_alter_instance.h:30
Rotate_innodb_master_key::execute
bool execute()
Definition: sql_alter_instance.cc:77
Rotate_binlog_master_key
Definition: sql_alter_instance.h:49
Alter_instance::~Alter_instance
virtual ~Alter_instance()
Definition: sql_alter_instance.h:38
Rotate_innodb_master_key::Rotate_innodb_master_key
Rotate_innodb_master_key(THD *thd)
Definition: sql_alter_instance.h:43
Alter_instance::Alter_instance
Alter_instance(THD *thd)
Definition: sql_alter_instance.h:35