MySQL  8.0.20
Source Code Documentation
user_table.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 USER_TABLE_INCLUDED
24 #define USER_TABLE_INCLUDED
25 
26 #include "my_inttypes.h"
27 
28 // Forward declarations
29 class Restrictions;
30 class THD;
31 struct LEX_USER;
32 struct TABLE;
33 
34 namespace acl_table {
35 
36 const ulong USER_ATTRIBUTE_NONE = 0L;
37 const ulong USER_ATTRIBUTE_RETAIN_PASSWORD = (1L << 0);
38 const ulong USER_ATTRIBUTE_DISCARD_PASSWORD = (1L << 1);
39 const ulong USER_ATTRIBUTE_RESTRICTIONS = (1L << 3);
41 const ulong USER_ATTRIBUTE_PASSWORD_LOCK_TIME = (1L << 5);
42 
44  public:
46  ulong m_what;
48 };
49 } // namespace acl_table
50 
51 int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo, ulong rights,
52  bool revoke_grant, bool can_create_user,
53  acl_table::Pod_user_what_to_update &what_to_update,
54  Restrictions *restrictions = nullptr);
55 
56 bool read_user_table(THD *thd, TABLE *table);
57 #endif /* USER_TABLE_INCLUDED */
Some integer typedefs for easier portability.
Container of all restrictions for a given user.
Definition: partial_revokes.h:123
const ulong USER_ATTRIBUTE_NONE
Definition: user_table.h:36
ulong m_user_attributes
Definition: user_table.h:47
Definition: table.h:1306
Definition: table.h:2380
Pod_user_what_to_update()
Definition: user_table.h:45
int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo, ulong rights, bool revoke_grant, bool can_create_user, acl_table::Pod_user_what_to_update &what_to_update, Restrictions *restrictions=nullptr)
Search and create/update a record for the user requested.
Definition: acl_table_user.cc:2086
Definition: acl_table_base.h:32
const ulong USER_ATTRIBUTE_RETAIN_PASSWORD
Definition: user_table.h:37
const ulong USER_ATTRIBUTE_PASSWORD_LOCK_TIME
Definition: user_table.h:41
const ulong USER_ATTRIBUTE_FAILED_LOGIN_ATTEMPTS
Definition: user_table.h:40
bool read_user_table(THD *thd, TABLE *table)
Read data from user table and fill in-memory caches.
Definition: acl_table_user.cc:2150
ulong m_what
Definition: user_table.h:46
#define L
Definition: ctype-tis620.cc:75
const ulong USER_ATTRIBUTE_DISCARD_PASSWORD
Definition: user_table.h:38
const ulong USER_ATTRIBUTE_RESTRICTIONS
Definition: user_table.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:765
Definition: user_table.h:43