MySQL 9.1.0
Source Code Documentation
acl_table_base.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 ACL_TABLE_BASE_INCLUDED
25#define ACL_TABLE_BASE_INCLUDED
26
27#include <assert.h>
28#include "my_base.h"
29
30class THD;
31struct TABLE;
32
33namespace acl_table {
34
36
39
40/**
41 Base class to handle ACL table manipulation
42*/
43
44class Acl_table {
45 public:
46 /* Constructor & Destructor */
48 : m_thd(thd), m_table(table), m_operation(operation), m_error(0) {
49 assert(m_table);
50 }
51 virtual ~Acl_table() = default;
52
53 /* Don't allow copy */
54 Acl_table(const Acl_table &) = delete;
55 const Acl_table &operator=(const Acl_table &) = delete;
56 Acl_table(const Acl_table &&) = delete;
57 const Acl_table &operator=(const Acl_table &&) = delete;
58
59 /* Finish a reade/write operation on given table */
62
63 protected:
66
69
71 }
72
73 /* Thread handle */
75 /* Table handle */
77 /* Mode - INSERT/UPDATE/DELETE/READ */
79 /* Table operation status */
81};
82
83} // namespace acl_table
84
85#endif /* ACL_TABLE_BASE_INCLUDED */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Base class to handle ACL table manipulation.
Definition: acl_table_base.h:44
Acl_table_operation m_operation
Definition: acl_table_base.h:78
virtual Acl_table_op_status finish_operation(Table_op_error_code &error)=0
virtual ~Acl_table()=default
const Acl_table & operator=(const Acl_table &)=delete
Acl_table_operation get_operation_mode()
Definition: acl_table_base.h:61
THD * m_thd
Definition: acl_table_base.h:74
Acl_table(THD *thd, TABLE *table, Acl_table_operation operation)
Definition: acl_table_base.h:47
Table_op_error_code m_error
Definition: acl_table_base.h:80
Acl_table(const Acl_table &)=delete
Acl_table_op_status convert_table_op_error_code()
Definition: acl_table_base.h:64
TABLE * m_table
Definition: acl_table_base.h:76
Acl_table(const Acl_table &&)=delete
const Acl_table & operator=(const Acl_table &&)=delete
This file includes constants used by all storage engines.
#define HA_ERR_KEY_NOT_FOUND
Didn't find key on read or update.
Definition: my_base.h:821
#define HA_ERR_END_OF_FILE
end in next/prev/first/last
Definition: my_base.h:853
Definition: acl_table_base.h:33
int Table_op_error_code
Definition: acl_table_base.h:35
Acl_table_op_status
Definition: acl_table_base.h:37
Acl_table_operation
Definition: acl_table_base.h:38
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: table.h:1421