MySQL  8.0.19
Source Code Documentation
acl_table_base.h
Go to the documentation of this file.
1 /* Copyright (c) 2018, 2019, 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 ACL_TABLE_BASE_INCLUDED
24 #define ACL_TABLE_BASE_INCLUDED
25 
26 #include "my_base.h"
27 #include "my_dbug.h"
28 
29 class THD;
30 struct TABLE;
31 
32 namespace acl_table {
33 
34 typedef int Table_op_error_code;
35 
38 
39 /**
40  Base class to handle ACL table manipulation
41 */
42 
43 class Acl_table {
44  public:
45  /* Constructor & Destructor */
46  Acl_table(THD *thd, TABLE *table, Acl_table_operation operation)
47  : m_thd(thd), m_table(table), m_operation(operation), m_error(0) {
49  }
50  virtual ~Acl_table() {}
51 
52  /* Don't allow copy */
53  Acl_table(const Acl_table &) = delete;
54  const Acl_table &operator=(const Acl_table &) = delete;
55  Acl_table(const Acl_table &&) = delete;
56  const Acl_table &operator=(const Acl_table &&) = delete;
57 
58  /* Finish a reade/write operation on given table */
61 
62  protected:
65 
68 
70  }
71 
72  /* Thread handle */
74  /* Table handle */
76  /* Mode - INSERT/UPDATE/DELETE/READ */
78  /* Table operation status */
80 };
81 
82 } // namespace acl_table
83 
84 #endif /* ACL_TABLE_BASE_INCLUDED */
acl_table::Acl_table::m_thd
THD * m_thd
Definition: acl_table_base.h:73
acl_table::Acl_table::m_table
TABLE * m_table
Definition: acl_table_base.h:75
THD
Definition: sql_class.h:764
HA_ERR_KEY_NOT_FOUND
#define HA_ERR_KEY_NOT_FOUND
Didn't find key on read or update.
Definition: my_base.h:817
acl_table::Acl_table::m_error
Table_op_error_code m_error
Definition: acl_table_base.h:79
acl_table::Acl_table_op_status::OP_ERROR_ROW
@ OP_ERROR_ROW
my_base.h
acl_table::Acl_table_operation
Acl_table_operation
Definition: acl_table_base.h:37
acl_table
Definition: acl_table_base.h:32
acl_table::Acl_table::get_operation_mode
Acl_table_operation get_operation_mode()
Definition: acl_table_base.h:60
HA_ERR_END_OF_FILE
#define HA_ERR_END_OF_FILE
end in next/prev/first/last
Definition: my_base.h:847
acl_table::Acl_table::convert_table_op_error_code
Acl_table_op_status convert_table_op_error_code()
Definition: acl_table_base.h:63
my_dbug.h
TABLE
Definition: table.h:1305
acl_table::Acl_table::~Acl_table
virtual ~Acl_table()
Definition: acl_table_base.h:50
acl_table::Acl_table_operation::OP_UPDATE
@ OP_UPDATE
acl_table::Acl_table
Base class to handle ACL table manipulation.
Definition: acl_table_base.h:43
acl_table::Acl_table::finish_operation
virtual Acl_table_op_status finish_operation(Table_op_error_code &error)=0
acl_table::Acl_table::m_operation
Acl_table_operation m_operation
Definition: acl_table_base.h:77
acl_table::Acl_table::operator=
const Acl_table & operator=(const Acl_table &)=delete
acl_table::Table_op_error_code
int Table_op_error_code
Definition: acl_table_base.h:34
DBUG_ASSERT
#define DBUG_ASSERT(A)
Definition: my_dbug.h:197
acl_table::Acl_table_op_status::OP_OK
@ OP_OK
acl_table::Acl_table::Acl_table
Acl_table(THD *thd, TABLE *table, Acl_table_operation operation)
Definition: acl_table_base.h:46
acl_table::Acl_table_operation::OP_READ
@ OP_READ
acl_table::Acl_table_op_status
Acl_table_op_status
Definition: acl_table_base.h:36
acl_table::Acl_table_op_status::OP_ERROR_CRITICAL
@ OP_ERROR_CRITICAL
acl_table::Acl_table_operation::OP_DELETE
@ OP_DELETE
acl_table::Acl_table_operation::OP_INSERT
@ OP_INSERT