MySQL 8.2.0
Source Code Documentation
sql_user_table.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2023, 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 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#ifndef SQL_USER_TABLE_INCLUDED
23#define SQL_USER_TABLE_INCLUDED
24
25#include "mysql/my_loglevel.h" // loglevel
26#include "sql/sql_system_table_check.h" // System_table_intact
27
28class THD;
29
30/**
31 Enum for ACL tables.
32 Keep in sync with Acl_table_names
33*/
34typedef enum ACL_TABLES {
45 LAST_ENTRY /* Must always be at the end */
47
48/**
49 Class to validate the flawlessness of ACL table
50 before performing ACL operations.
51*/
53 public:
54 Acl_table_intact(THD *c_thd, enum loglevel log_level = ERROR_LEVEL)
55 : System_table_intact(c_thd, log_level) {}
56
57 /**
58 Checks whether an ACL table is intact.
59
60 Works in conjunction with @ref mysql_acl_table_defs and
61 Table_check_intact::check()
62
63 @param table Table to check.
64 @param acl_table ACL Table "id"
65
66 @retval false OK
67 @retval true There was an error.
68 */
72 }
73
74 private:
76};
77
78int handle_grant_table(THD *, Table_ref *tables, ACL_TABLES table_no, bool drop,
79 LEX_USER *user_from, LEX_USER *user_to);
80
81#endif /* SQL_USER_TABLE_INCLUDED */
Class to validate the flawlessness of ACL table before performing ACL operations.
Definition: sql_user_table.h:52
Acl_table_intact(THD *c_thd, enum loglevel log_level=ERROR_LEVEL)
Definition: sql_user_table.h:54
bool check(TABLE *table, ACL_TABLES acl_table)
Checks whether an ACL table is intact.
Definition: sql_user_table.h:69
static const TABLE_FIELD_DEF mysql_acl_table_defs[]
keep in sync with ACL_TABLES
Definition: sql_user_table.h:75
Class to check if system table is intact.
Definition: sql_system_table_check.h:36
THD * thd()
Definition: sql_system_table_check.h:43
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
bool check(THD *thd, TABLE *table, const TABLE_FIELD_DEF *table_def)
Checks whether a table is intact.
Definition: table.cc:3757
Definition: table.h:2846
bool drop(THD *thd, const Table *tp)
Remove SDI for a table.
Definition: sdi.cc:638
Definition of the global "loglevel" enumeration.
loglevel
Definition: my_loglevel.h:40
@ ERROR_LEVEL
Definition: my_loglevel.h:42
Definition: acl_table_base.h:32
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
ACL_TABLES
Enum for ACL tables.
Definition: sql_user_table.h:34
@ TABLE_PASSWORD_HISTORY
Definition: sql_user_table.h:44
@ TABLE_DEFAULT_ROLES
Definition: sql_user_table.h:42
@ TABLE_PROXIES_PRIV
Definition: sql_user_table.h:40
@ TABLE_DB
Definition: sql_user_table.h:36
@ TABLE_COLUMNS_PRIV
Definition: sql_user_table.h:38
@ TABLE_TABLES_PRIV
Definition: sql_user_table.h:37
@ TABLE_DYNAMIC_PRIV
Definition: sql_user_table.h:43
@ TABLE_ROLE_EDGES
Definition: sql_user_table.h:41
@ LAST_ENTRY
Definition: sql_user_table.h:45
@ TABLE_PROCS_PRIV
Definition: sql_user_table.h:39
@ TABLE_USER
Definition: sql_user_table.h:35
int handle_grant_table(THD *, Table_ref *tables, ACL_TABLES table_no, bool drop, LEX_USER *user_from, LEX_USER *user_to)
Handle a privilege table.
Definition: sql_user_table.cc:2097
Definition: table.h:2713
Definition: table.h:591
Definition: table.h:1396