MySQL 9.0.0
Source Code Documentation
read_mode_handler.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, 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 READ_MODE_HANDLER_INCLUDE
25#define READ_MODE_HANDLER_INCLUDE
26
27#include <string>
28
29/**
30 Enable the super read only mode in the server.
31
32 @param reason explains why we set the mode
33 @return the operation status
34 @retval 0 OK
35 @retval !=0 Error
36*/
37int enable_server_read_mode(const std::string &reason);
38
39/**
40 Disable the read only mode in the server.
41
42 @return the operation status
43 @retval 0 OK
44 @retval !=0 Error
45*/
47
48/**
49 Get read mode status from server.
50
51 @param read_only_enabled Update with value of read only mode
52 @param super_read_only_enabled Update with value of super read only mode
53
54 @return the operation status
55 @retval 0 OK
56 @retval !=0 Error
57*/
58int get_read_mode_state(bool *read_only_enabled, bool *super_read_only_enabled);
59
60/**
61 Set read mode status from server.
62
63 @param read_only_enabled Value to set on read only mode
64 @param super_read_only_enabled Value to set on super read only mode
65
66 @return the operation status
67 @retval 0 OK
68 @retval !=0 Error
69*/
70int set_read_mode_state(bool read_only_enabled, bool super_read_only_enabled);
71
72#endif /* READ_MODE_HANDLER_INCLUDE */
int enable_server_read_mode(const std::string &reason)
Enable the super read only mode in the server.
Definition: read_mode_handler.cc:32
int set_read_mode_state(bool read_only_enabled, bool super_read_only_enabled)
Set read mode status from server.
Definition: read_mode_handler.cc:88
int get_read_mode_state(bool *read_only_enabled, bool *super_read_only_enabled)
Get read mode status from server.
Definition: read_mode_handler.cc:63
int disable_server_read_mode()
Disable the read only mode in the server.
Definition: read_mode_handler.cc:53