MySQL 8.3.0
Source Code Documentation
sql_security_ctx.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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_SECURITY_CTX_INCLUDED
23#define SQL_SECURITY_CTX_INCLUDED
24#include <string.h>
25#include <sys/types.h>
26#include <algorithm>
27#include <utility>
28
29#include "lex_string.h"
30#include "my_dbug.h"
31#include "my_hostname.h" // HOSTNAME_LENGTH
32#include "mysql_com.h" // USERNAME_LENGTH
35#include "sql/mysqld_cs.h"
36#include "sql/sql_const.h"
37#include "sql_string.h"
38
39/* Forward declaration. Depends on sql_auth_cache.h (which depends on this file)
40 */
41class Acl_map;
42class ACL_USER;
43class THD;
44struct TABLE;
46
47/**
48 @class Security_context
49 @brief A set of THD members describing the current authenticated user.
50*/
51
53 public:
54 Security_context(THD *thd = nullptr);
56
57 Security_context(const Security_context &src_sctx);
58
60
61 void skip_grants(const char *user = "skip-grants user",
62 const char *host = "skip-grants host");
64
65 /**
66 Getter method for member m_user.
67
68 @retval LEX_CSTRING object having constant pointer to m_user.Ptr
69 and its length.
70 */
71 LEX_CSTRING user() const;
72
73 void set_user_ptr(const char *user_arg, const size_t user_arg_length);
74
75 void assign_user(const char *user_arg, const size_t user_arg_length);
76
77 std::pair<bool, bool> has_global_grant(const char *priv, size_t priv_len);
78 std::pair<bool, bool> has_global_grant(const Auth_id &auth_id,
79 const std::string &privilege,
80 bool cumulative = false);
81 bool can_operate_with(const Auth_id &auth_id, const std::string &privilege,
82 bool cumulative = false,
83 bool ignore_if_nonextant = true,
84 bool throw_error = true);
86 bool validate_access = false);
87 void clear_active_roles(void);
89 size_t get_num_active_roles() const;
91 void checkout_access_maps(void);
92 ulong db_acl(LEX_CSTRING db, bool use_pattern_scan = true) const;
93 static ulong check_db_level_access(THD *thd, const Security_context *sctx,
94 const char *host, const char *ip,
95 const char *user, const char *db,
96 size_t db_len, bool db_is_pattern = false);
97 ulong check_db_level_access(THD *thd, const char *db, size_t db_len,
98 bool db_is_pattern = false) const;
99 ulong procedure_acl(LEX_CSTRING db, LEX_CSTRING procedure_name);
100 ulong function_acl(LEX_CSTRING db, LEX_CSTRING procedure_name);
104 bool has_with_admin_acl(const LEX_CSTRING &role_name,
105 const LEX_CSTRING &role_host);
106 bool any_sp_acl(const LEX_CSTRING &db);
107 bool any_table_acl(const LEX_CSTRING &db);
108
109 bool is_table_blocked(ulong priv, TABLE const *table);
110 bool has_column_access(ulong priv, TABLE const *table,
111 std::vector<std::string> column);
112
113 /**
114 Getter method for member m_host.
115
116 @retval LEX_CSTRING object having constant pointer to m_host.Ptr
117 and its length.
118 */
119
120 LEX_CSTRING host() const;
121
122 void set_host_ptr(const char *host_arg, const size_t host_arg_length);
123
124 void assign_host(const char *host_arg, const size_t host_arg_length);
125
126 /**
127 Getter method for member m_ip.
128
129 @retval LEX_CSTRING object having constant pointer to m_ip.Ptr
130 and its length
131 */
132 LEX_CSTRING ip() const;
133
134 void set_ip_ptr(const char *ip_arg, const int ip_arg_length);
135
136 void assign_ip(const char *ip_arg, const int ip_arg_length);
137
138 /**
139 Getter method for member m_host_or_ip.
140
141 @retval LEX_CSTRING object having constant pointer to m_host_or_ip.Ptr
142 and its length
143 */
144 LEX_CSTRING host_or_ip() const;
145
146 /**
147 Setter method for member m_host_or_ip.
148 */
149 void set_host_or_ip_ptr();
150
151 /**
152 Setter method for member m_host_or_ip.
153
154 @param[in] host_or_ip_arg New user value for m_host_or_ip.
155 @param[in] host_or_ip_arg_length Length of "host_or_ip_arg" param.
156 */
157 void set_host_or_ip_ptr(const char *host_or_ip_arg,
158 const int host_or_ip_arg_length);
159
160 /**
161 Getter method for member m_external_user.
162
163 @retval LEX_CSTRING object having constant pointer to m_external_host.Ptr
164 and its length
165 */
167
168 void set_external_user_ptr(const char *ext_user_arg,
169 const int ext_user_arg_length);
170
171 void assign_external_user(const char *ext_user_arg,
172 const int ext_user_arg_length);
173
174 /**
175 Getter method for member m_priv_user.
176
177 @retval LEX_CSTRING object having constant pointer to m_priv_user.Ptr
178 and its length
179 */
180 LEX_CSTRING priv_user() const;
181
182 void assign_priv_user(const char *priv_user_arg,
183 const size_t priv_user_arg_length);
184
185 /**
186 Getter method for member m_proxy_user.
187
188 @retval LEX_CSTRING object having constant pointer to m_proxy_user.Ptr
189 and its length
190 */
191 LEX_CSTRING proxy_user() const;
192
193 void assign_proxy_user(const char *proxy_user_arg,
194 const size_t proxy_user_arg_length);
195
196 /**
197 Getter method for member m_priv_host.
198
199 @retval LEX_CSTRING object having constant pointer to m_priv_host.Ptr
200 and its length
201 */
202 LEX_CSTRING priv_host() const;
203
204 void assign_priv_host(const char *priv_host_arg,
205 const size_t priv_host_arg_length);
206
207 const char *priv_host_name() const;
208
209 /**
210 Getter method for member m_master_access.
211 */
212 ulong master_access() const;
213
214 ulong master_access(const std::string &db_name) const;
215
216 const Restrictions restrictions() const;
217
219
221
222 /**
223 Check if a an account has been assigned to the security context
224
225 The account assignment to the security context is always executed in the
226 following order:
227 1) assign user's name to the context
228 2) assign user's hostname to the context
229 Whilst user name can be null, hostname cannot. This is why we can say that
230 the full account has been assigned to the context when hostname is not
231 equal to empty string.
232
233 @return Account assignment status
234 @retval true account has been assigned to the security context
235 @retval false account has not yet been assigned to the security context
236 */
237
238 bool has_account_assigned() const;
239
240 /**
241 Check permission against m_master_access
242 */
243
244 /**
245 Check global access
246 @param want_access The required privileges
247 @param db_name The database name to check if it has restrictions attached
248 @param match_any if the security context must match all or any of the req.
249 * privileges.
250 @return True if the security context fulfills the access requirements.
251 */
252 bool check_access(ulong want_access, const std::string &db_name = "",
253 bool match_any = false);
254
255 /**
256 Returns the schema level effective privileges (with applied roles)
257 for the currently active schema.
258 */
259 ulong current_db_access() const;
260
261 /**
262 Cache the schema level effective privileges (apply roles first!) for the
263 currently active schema.
264 */
265 void cache_current_db_access(ulong db_access);
266
267 /**
268 Getter method for member m_password_expired.
269 */
270 bool password_expired() const;
271
273
274 bool change_security_context(THD *thd, const LEX_CSTRING &definer_user,
275 const LEX_CSTRING &definer_host, const char *db,
276 Security_context **backup, bool force = false);
277
279
281
282 void logout();
283 /**
284 Locked account can still be used as routine definers and when they are
285 there shouldn't be any checks for expired passwords.
286 */
288
290
291 void set_drop_policy(const std::function<void(Security_context *)> &func);
292
293 void add_as_local_temp_privs(const std::vector<std::string> &privs);
294 bool check_in_local_temp_privs(const std::string &priv);
295
296 bool has_drop_policy(void);
297
298 bool has_executed_drop_policy(void);
299
300 void execute_drop_policy(void);
301
302 bool is_access_restricted_on_db(ulong want_access,
303 const std::string &db_name) const;
304
306
309
310 void set_thd(THD *thd);
311
312 THD *get_thd();
313
314 private:
315 void init();
316 void destroy();
317 void copy_security_ctx(const Security_context &src_sctx);
318 ulong filter_access(const ulong access, const std::string &db_name) const;
320 std::pair<bool, bool> fetch_global_grant(const ACL_USER &acl_user,
321 const std::string &privilege,
322 bool cumulative = false);
323 bool has_table_access(ulong priv, Table_ref *table);
324
325 private:
326 /**
327 m_user - user of the client, set to NULL until the user has been read from
328 the connection
329 */
331
332 /** m_host - host of the client */
334
335 /** m_ip - client IP */
337
338 /**
339 m_host_or_ip - points to host if host is available, otherwise points to ip
340 */
342
344
345 /**
346 m_priv_user - The user privilege we are using. May be "" for anonymous user.
347 */
350
353
354 /**
355 The host privilege we are using
356 */
359
360 /**
361 Global privileges from mysql.user.
362 */
364
365 /**
366 Privileges for current db
367 */
369
370 /**
371 password expiration flag.
372
373 This flag is set according to connecting user's context and not the
374 effective user.
375 */
379 /**
380 True if this account can't be logged into.
381 */
383 /**
384 True if the skip_grants_user is set.
385 */
387
392 /**
393 This flag tracks if server should be in sandbox mode or not.
394 When user account connects to server, with any of its authentication
395 plugin's registration step pending, in that case, the connection is
396 set in sandbox(or registration) mode i.e m_registration_sandbox_mode is set
397 to TRUE.
398 During this time only ALTER USER, SET PASSWORD statements are allowed.
399 Once user finishes the registration steps for the authentication plugin
400 via an ALTER USER statement, m_registration_sandbox_mode is set to FALSE,
401 making a full fledged connection, where user can execute any sql statement.
402 */
404
405 /**
406 m_thd - Thread handle, set to nullptr if this does not belong to any THD yet
407 */
409};
410
411/**
412 Getter method for member m_host_or_ip.
413
414 @retval LEX_CSTRING object having constant pointer to m_host_or_ip.Ptr
415 and its length
416*/
419
421
424
425 return host_or_ip;
426}
427
430
431 /*
432 Set host_or_ip to either host or ip if they are available else set it to
433 empty string.
434 */
435 const char *host_or_ip =
436 m_host.length() ? m_host.ptr() : (m_ip.length() ? m_ip.ptr() : "");
437
439}
440
442 const char *host_or_ip_arg, const int host_or_ip_arg_length) {
444
445 m_host_or_ip.set(host_or_ip_arg, host_or_ip_arg_length, system_charset_info);
446}
447
449 LEX_CSTRING ext_user;
450
452
453 ext_user.str = m_external_user.ptr();
454 ext_user.length = m_external_user.length();
455
456 return ext_user;
457}
458
459inline ulong Security_context::master_access() const { return m_master_access; }
460
462 return m_restrictions;
463}
464
465inline void Security_context::set_master_access(ulong master_access) {
468 DBUG_PRINT("info", ("Cached master access is %lu", m_master_access));
469}
470
472 ulong master_access, const Restrictions &restrictions) {
475}
476
477inline const char *Security_context::priv_host_name() const {
478 return (*m_priv_host ? m_priv_host : "%");
479}
480
482 return m_priv_host[0] != '\0';
483}
484
485inline ulong Security_context::current_db_access() const { return m_db_access; }
486
487inline void Security_context::cache_current_db_access(ulong db_access) {
488 m_db_access = db_access;
489}
490
492 return m_password_expired;
493}
494
495inline void Security_context::set_password_expired(bool password_expired) {
497}
498
501}
502
505}
506
509}
510
513}
514
515inline void Security_context::set_thd(THD *thd) { m_thd = thd; }
516
518
519#endif /* SQL_SECURITY_CTX_INCLUDED */
std::vector< Auth_id_ref > List_of_auth_id_refs
Definition: auth_common.h:79
Definition: sql_auth_cache.h:245
Container for global, schema, table/view and routine ACL maps.
Definition: sql_auth_cache.h:636
Storage container for default auth ids.
Definition: auth_common.h:1065
Definition: sql_list.h:434
Container of all restrictions for a given user.
Definition: partial_revokes.h:154
void clear_db()
Clear database restrictions.
Definition: partial_revokes.cc:1496
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:52
bool user_matches(Security_context *)
Definition: sql_security_ctx.cc:312
String m_external_user
Definition: sql_security_ctx.h:343
ulong db_acl(LEX_CSTRING db, bool use_pattern_scan=true) const
Get grant information for given database.
Definition: sql_security_ctx.cc:502
bool has_table_access(ulong priv, Table_ref *table)
Check if required access to given table is granted.
Definition: sql_security_ctx.cc:1242
THD * get_thd()
Definition: sql_security_ctx.h:517
Grant_table_aggregate table_and_column_acls(LEX_CSTRING db, LEX_CSTRING table)
Definition: sql_security_ctx.cc:621
bool any_table_acl(const LEX_CSTRING &db)
Definition: sql_security_ctx.cc:669
void set_master_access(ulong master_access)
Definition: sql_security_ctx.h:465
String m_host
m_host - host of the client
Definition: sql_security_ctx.h:333
bool m_is_skip_grants_user
True if the skip_grants_user is set.
Definition: sql_security_ctx.h:386
bool check_in_local_temp_privs(const std::string &priv)
std::unique_ptr< std::function< void(Security_context *)> > m_drop_policy
Definition: sql_security_ctx.h:390
void add_as_local_temp_privs(const std::vector< std::string > &privs)
void cache_current_db_access(ulong db_access)
Cache the schema level effective privileges (apply roles first!) for the currently active schema.
Definition: sql_security_ctx.h:487
const char * priv_host_name() const
Definition: sql_security_ctx.h:477
void set_user_ptr(const char *user_arg, const size_t user_arg_length)
Setter method for member m_user.
Definition: sql_security_ctx.cc:865
ulong function_acl(LEX_CSTRING db, LEX_CSTRING procedure_name)
Definition: sql_security_ctx.cc:603
void init()
Definition: sql_security_ctx.cc:79
LEX_CSTRING host() const
Getter method for member m_host.
Definition: sql_security_ctx.cc:903
LEX_CSTRING priv_user() const
Getter method for member m_priv_user.
Definition: sql_security_ctx.cc:831
void assign_user(const char *user_arg, const size_t user_arg_length)
Setter method for member m_user.
Definition: sql_security_ctx.cc:885
void copy_security_ctx(const Security_context &src_sctx)
Deep copy status of sctx object to this.
Definition: sql_security_ctx.cc:202
void set_password_expired(bool password_expired)
Definition: sql_security_ctx.h:495
void set_drop_policy(const std::function< void(Security_context *)> &func)
Definition: sql_security_ctx.cc:126
int activate_role(LEX_CSTRING user, LEX_CSTRING host, bool validate_access=false)
This method pushes a role to the list of active roles.
Definition: sql_security_ctx.cc:349
void set_registration_sandbox_mode(bool v)
Definition: sql_security_ctx.h:511
Restrictions m_restrictions
Definition: sql_security_ctx.h:391
static ulong check_db_level_access(THD *thd, const Security_context *sctx, const char *host, const char *ip, const char *user, const char *db, size_t db_len, bool db_is_pattern=false)
Checks if any database level privileges are granted to the current session either directly or through...
Definition: sql_security_ctx.cc:551
char m_priv_user[USERNAME_LENGTH]
m_priv_user - The user privilege we are using.
Definition: sql_security_ctx.h:348
ulong filter_access(const ulong access, const std::string &db_name) const
If there is a restriction attached to an access on the given database then remove that access otherwi...
Definition: sql_security_ctx.cc:1179
void assign_proxy_user(const char *proxy_user_arg, const size_t proxy_user_arg_length)
Setter method for member m_proxy_user.
Definition: sql_security_ctx.cc:1108
void skip_grants(const char *user="skip-grants user", const char *host="skip-grants host")
Grants all privilegs to user.
Definition: sql_security_ctx.cc:175
~Security_context()
Definition: sql_security_ctx.cc:60
void checkout_access_maps(void)
Subscribes to a cache entry of aggregated ACLs.
Definition: sql_security_ctx.cc:380
size_t get_num_active_roles() const
Definition: sql_security_ctx.cc:447
THD * m_thd
m_thd - Thread handle, set to nullptr if this does not belong to any THD yet
Definition: sql_security_ctx.h:408
char m_proxy_user[USERNAME_LENGTH+HOSTNAME_LENGTH+6]
Definition: sql_security_ctx.h:351
void set_external_user_ptr(const char *ext_user_arg, const int ext_user_arg_length)
Setter method for member m_external_user.
Definition: sql_security_ctx.cc:1030
String m_user
m_user - user of the client, set to NULL until the user has been read from the connection
Definition: sql_security_ctx.h:330
String m_ip
m_ip - client IP
Definition: sql_security_ctx.h:336
ulong m_db_access
Privileges for current db.
Definition: sql_security_ctx.h:368
bool any_sp_acl(const LEX_CSTRING &db)
Definition: sql_security_ctx.cc:654
ulong master_access() const
Getter method for member m_master_access.
Definition: sql_security_ctx.h:459
bool has_account_assigned() const
Check if a an account has been assigned to the security context.
Definition: sql_security_ctx.h:481
size_t m_proxy_user_length
Definition: sql_security_ctx.h:352
bool has_column_access(ulong priv, TABLE const *table, std::vector< std::string > column)
Check if required access to given table column is granted.
Definition: sql_security_ctx.cc:1319
LEX_CSTRING external_user() const
Getter method for member m_external_user.
Definition: sql_security_ctx.h:448
void assign_host(const char *host_arg, const size_t host_arg_length)
Setter method for member m_host.
Definition: sql_security_ctx.cc:946
void set_host_ptr(const char *host_arg, const size_t host_arg_length)
Setter method for member m_host.
Definition: sql_security_ctx.cc:923
bool m_is_locked
True if this account can't be logged into.
Definition: sql_security_ctx.h:382
bool is_in_registration_sandbox_mode()
Definition: sql_security_ctx.h:507
bool is_access_restricted_on_db(ulong want_access, const std::string &db_name) const
Definition: sql_security_ctx.cc:1164
bool m_password_expired
password expiration flag.
Definition: sql_security_ctx.h:376
size_t m_priv_user_length
Definition: sql_security_ctx.h:349
bool account_is_locked()
Locked account can still be used as routine definers and when they are there shouldn't be any checks ...
Definition: sql_security_ctx.h:287
ulong procedure_acl(LEX_CSTRING db, LEX_CSTRING procedure_name)
Definition: sql_security_ctx.cc:585
Security_context(THD *thd=nullptr)
Definition: sql_security_ctx.cc:55
void execute_drop_policy(void)
Definition: sql_security_ctx.cc:119
void assign_ip(const char *ip_arg, const int ip_arg_length)
Setter method for member m_ip.
Definition: sql_security_ctx.cc:1010
List_of_auth_id_refs * get_active_roles()
Definition: sql_security_ctx.cc:443
void init_restrictions(const Restrictions &restrictions)
Definition: sql_security_ctx.cc:1160
Acl_map * m_acl_map
Definition: sql_security_ctx.h:378
void assign_external_user(const char *ext_user_arg, const int ext_user_arg_length)
Setter method for member m_external_user.
Definition: sql_security_ctx.cc:1050
bool has_with_admin_acl(const LEX_CSTRING &role_name, const LEX_CSTRING &role_host)
Definition: sql_security_ctx.cc:640
bool password_expired() const
Getter method for member m_password_expired.
Definition: sql_security_ctx.h:491
LEX_CSTRING ip() const
Getter method for member m_ip.
Definition: sql_security_ctx.cc:970
char m_priv_host[HOSTNAME_LENGTH+1]
The host privilege we are using.
Definition: sql_security_ctx.h:357
size_t m_priv_host_length
Definition: sql_security_ctx.h:358
LEX_CSTRING priv_host() const
Getter method for member m_priv_host.
Definition: sql_security_ctx.cc:1128
ulong table_acl(LEX_CSTRING db, LEX_CSTRING table)
Definition: sql_security_ctx.cc:634
void set_host_or_ip_ptr()
Setter method for member m_host_or_ip.
Definition: sql_security_ctx.h:428
bool is_table_blocked(ulong priv, TABLE const *table)
Check if required access to given table is not restricted.
Definition: sql_security_ctx.cc:1286
bool check_access(ulong want_access, const std::string &db_name="", bool match_any=false)
Check permission against m_master_access.
Definition: sql_security_ctx.cc:321
std::pair< bool, bool > fetch_global_grant(const ACL_USER &acl_user, const std::string &privilege, bool cumulative=false)
Checks if the acl_user does have the asked dynamic privilege.
Definition: sql_security_ctx.cc:1208
std::pair< bool, bool > has_global_grant(const char *priv, size_t priv_len)
Checks if the Current_user has the asked dynamic privilege.
Definition: sql_security_ctx.cc:699
void set_thd(THD *thd)
Definition: sql_security_ctx.h:515
void destroy()
Definition: sql_security_ctx.cc:133
String m_host_or_ip
m_host_or_ip - points to host if host is available, otherwise points to ip
Definition: sql_security_ctx.h:341
bool m_has_drop_policy
Definition: sql_security_ctx.h:389
LEX_CSTRING user() const
Getter method for member m_user.
Definition: sql_security_ctx.cc:845
void clear_db_restrictions()
Definition: sql_security_ctx.h:503
bool m_executed_drop_policy
Definition: sql_security_ctx.h:388
void logout()
Definition: sql_security_ctx.cc:100
void restore_security_context(THD *thd, Security_context *backup)
Definition: sql_security_ctx.cc:307
const Restrictions restrictions() const
Definition: sql_security_ctx.h:461
bool m_registration_sandbox_mode
This flag tracks if server should be in sandbox mode or not.
Definition: sql_security_ctx.h:403
void lock_account(bool is_locked)
Definition: sql_security_ctx.h:289
LEX_CSTRING host_or_ip() const
Getter method for member m_host_or_ip.
Definition: sql_security_ctx.h:417
bool is_skip_grants_user()
Definition: sql_security_ctx.h:499
ulong m_master_access
Global privileges from mysql.user.
Definition: sql_security_ctx.h:363
List_of_auth_id_refs m_active_roles
Definition: sql_security_ctx.h:377
bool has_executed_drop_policy(void)
Definition: sql_security_ctx.cc:115
bool has_drop_policy(void)
Definition: sql_security_ctx.cc:113
bool change_security_context(THD *thd, const LEX_CSTRING &definer_user, const LEX_CSTRING &definer_host, const char *db, Security_context **backup, bool force=false)
Initialize this security context from the passed in credentials and activate it in the current thread...
Definition: sql_security_ctx.cc:280
void assign_priv_user(const char *priv_user_arg, const size_t priv_user_arg_length)
Setter method for member m_priv_user.
Definition: sql_security_ctx.cc:1070
ulong current_db_access() const
Returns the schema level effective privileges (with applied roles) for the currently active schema.
Definition: sql_security_ctx.h:485
void set_ip_ptr(const char *ip_arg, const int ip_arg_length)
Setter method for member m_ip.
Definition: sql_security_ctx.cc:990
Security_context & operator=(const Security_context &src_sctx)
Definition: sql_security_ctx.cc:67
bool can_operate_with(const Auth_id &auth_id, const std::string &privilege, bool cumulative=false, bool ignore_if_nonextant=true, bool throw_error=true)
Checks if the specified auth_id with privilege can work with the current_user.
Definition: sql_security_ctx.cc:793
void clear_active_roles(void)
This helper method clears the active roles list and frees the allocated memory used for any previousl...
Definition: sql_security_ctx.cc:424
LEX_CSTRING proxy_user() const
Getter method for member m_proxy_user.
Definition: sql_security_ctx.cc:1090
void assign_priv_host(const char *priv_host_arg, const size_t priv_host_arg_length)
Setter method for member m_priv_host.
Definition: sql_security_ctx.cc:1146
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
const char * ptr() const
Definition: sql_string.h:248
size_t length() const
Definition: sql_string.h:240
void set(String &str, size_t offset, size_t arg_length)
Definition: sql_string.h:279
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
Definition: table.h:2853
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1556
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:180
#define DBUG_TRACE
Definition: my_dbug.h:145
Common definition used by mysys, performance schema and server & client.
static constexpr int HOSTNAME_LENGTH
Definition: my_hostname.h:42
static bool backup
Definition: myisampack.cc:197
Common definition between mysql server & client.
#define USERNAME_LENGTH
Definition: mysql_com.h:68
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
const char * db_name
Definition: rules_table_service.cc:54
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2437
File containing constants that can be used throughout the server.
Our own string classes, used pervasively throughout the executor.
Definition: auth_internal.h:58
Definition: mysql_lex_string.h:39
const char * str
Definition: mysql_lex_string.h:40
size_t length
Definition: mysql_lex_string.h:41
Definition: table.h:1403
int is_locked(int fd)