MySQL 8.0.33
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 "m_ctype.h"
31#include "m_string.h"
32#include "my_dbug.h"
33#include "my_hostname.h" // HOSTNAME_LENGTH
34#include "mysql_com.h" // USERNAME_LENGTH
37#include "sql/sql_const.h"
38#include "sql_string.h"
39
40/* Forward declaration. Depends on sql_auth_cache.h (which depends on this file)
41 */
42class Acl_map;
43class ACL_USER;
44class THD;
45struct TABLE;
47
48/**
49 @class Security_context
50 @brief A set of THD members describing the current authenticated user.
51*/
52
54 public:
55 Security_context(THD *thd = nullptr);
57
58 Security_context(const Security_context &src_sctx);
59
61
62 void skip_grants(const char *user = "skip-grants user",
63 const char *host = "skip-grants host");
65
66 /**
67 Getter method for member m_user.
68
69 @retval LEX_CSTRING object having constant pointer to m_user.Ptr
70 and its length.
71 */
72 LEX_CSTRING user() const;
73
74 void set_user_ptr(const char *user_arg, const size_t user_arg_length);
75
76 void assign_user(const char *user_arg, const size_t user_arg_length);
77
78 std::pair<bool, bool> has_global_grant(const char *priv, size_t priv_len);
79 std::pair<bool, bool> has_global_grant(const Auth_id &auth_id,
80 const std::string &privilege,
81 bool cumulative = false);
82 bool can_operate_with(const Auth_id &auth_id, const std::string &privilege,
83 bool cumulative = false,
84 bool ignore_if_nonextant = true,
85 bool throw_error = true);
87 bool validate_access = false);
88 void clear_active_roles(void);
90 size_t get_num_active_roles() const;
92 void checkout_access_maps(void);
93 ulong db_acl(LEX_CSTRING db, bool use_pattern_scan = true) const;
94 ulong procedure_acl(LEX_CSTRING db, LEX_CSTRING procedure_name);
95 ulong function_acl(LEX_CSTRING db, LEX_CSTRING procedure_name);
96 ulong table_acl(LEX_CSTRING db, LEX_CSTRING table);
98 LEX_CSTRING table);
99 bool has_with_admin_acl(const LEX_CSTRING &role_name,
100 const LEX_CSTRING &role_host);
101 bool any_sp_acl(const LEX_CSTRING &db);
102 bool any_table_acl(const LEX_CSTRING &db);
103
104 bool is_table_blocked(ulong priv, TABLE const *table);
105 bool has_column_access(ulong priv, TABLE const *table,
106 std::vector<std::string> column);
107
108 /**
109 Getter method for member m_host.
110
111 @retval LEX_CSTRING object having constant pointer to m_host.Ptr
112 and its length.
113 */
114
115 LEX_CSTRING host() const;
116
117 void set_host_ptr(const char *host_arg, const size_t host_arg_length);
118
119 void assign_host(const char *host_arg, const size_t host_arg_length);
120
121 /**
122 Getter method for member m_ip.
123
124 @retval LEX_CSTRING object having constant pointer to m_ip.Ptr
125 and its length
126 */
127 LEX_CSTRING ip() const;
128
129 void set_ip_ptr(const char *ip_arg, const int ip_arg_length);
130
131 void assign_ip(const char *ip_arg, const int ip_arg_length);
132
133 /**
134 Getter method for member m_host_or_ip.
135
136 @retval LEX_CSTRING object having constant pointer to m_host_or_ip.Ptr
137 and its length
138 */
139 LEX_CSTRING host_or_ip() const;
140
141 /**
142 Setter method for member m_host_or_ip.
143 */
144 void set_host_or_ip_ptr();
145
146 /**
147 Setter method for member m_host_or_ip.
148
149 @param[in] host_or_ip_arg New user value for m_host_or_ip.
150 @param[in] host_or_ip_arg_length Length of "host_or_ip_arg" param.
151 */
152 void set_host_or_ip_ptr(const char *host_or_ip_arg,
153 const int host_or_ip_arg_length);
154
155 /**
156 Getter method for member m_external_user.
157
158 @retval LEX_CSTRING object having constant pointer to m_external_host.Ptr
159 and its length
160 */
162
163 void set_external_user_ptr(const char *ext_user_arg,
164 const int ext_user_arg_length);
165
166 void assign_external_user(const char *ext_user_arg,
167 const int ext_user_arg_length);
168
169 /**
170 Getter method for member m_priv_user.
171
172 @retval LEX_CSTRING object having constant pointer to m_priv_user.Ptr
173 and its length
174 */
175 LEX_CSTRING priv_user() const;
176
177 void assign_priv_user(const char *priv_user_arg,
178 const size_t priv_user_arg_length);
179
180 /**
181 Getter method for member m_proxy_user.
182
183 @retval LEX_CSTRING object having constant pointer to m_proxy_user.Ptr
184 and its length
185 */
186 LEX_CSTRING proxy_user() const;
187
188 void assign_proxy_user(const char *proxy_user_arg,
189 const size_t proxy_user_arg_length);
190
191 /**
192 Getter method for member m_priv_host.
193
194 @retval LEX_CSTRING object having constant pointer to m_priv_host.Ptr
195 and its length
196 */
197 LEX_CSTRING priv_host() const;
198
199 void assign_priv_host(const char *priv_host_arg,
200 const size_t priv_host_arg_length);
201
202 const char *priv_host_name() const;
203
204 /**
205 Getter method for member m_master_access.
206 */
207 ulong master_access() const;
208
209 ulong master_access(const std::string &db_name) const;
210
211 const Restrictions restrictions() const;
212
214
216
217 /**
218 Check if a an account has been assigned to the security context
219
220 The account assignment to the security context is always executed in the
221 following order:
222 1) assign user's name to the context
223 2) assign user's hostname to the context
224 Whilst user name can be null, hostname cannot. This is why we can say that
225 the full account has been assigned to the context when hostname is not
226 equal to empty string.
227
228 @return Account assignment status
229 @retval true account has been assigned to the security context
230 @retval false account has not yet been assigned to the security context
231 */
232
233 bool has_account_assigned() const;
234
235 /**
236 Check permission against m_master_access
237 */
238
239 /**
240 Check global access
241 @param want_access The required privileges
242 @param db_name The database name to check if it has restrictions attached
243 @param match_any if the security context must match all or any of the req.
244 * privileges.
245 @return True if the security context fulfills the access requirements.
246 */
247 bool check_access(ulong want_access, const std::string &db_name = "",
248 bool match_any = false);
249
250 /**
251 Returns the schema level effective privileges (with applied roles)
252 for the currently active schema.
253 */
254 ulong current_db_access() const;
255
256 /**
257 Cache the schema level effective privileges (apply roles first!) for the
258 currently active schema.
259 */
260 void cache_current_db_access(ulong db_access);
261
262 /**
263 Getter method for member m_password_expired.
264 */
265 bool password_expired() const;
266
268
269 bool change_security_context(THD *thd, const LEX_CSTRING &definer_user,
270 const LEX_CSTRING &definer_host, const char *db,
271 Security_context **backup, bool force = false);
272
274
276
277 void logout();
278 /**
279 Locked account can still be used as routine definers and when they are
280 there shouldn't be any checks for expired passwords.
281 */
283
285
286 void set_drop_policy(const std::function<void(Security_context *)> &func);
287
288 void add_as_local_temp_privs(const std::vector<std::string> &privs);
289 bool check_in_local_temp_privs(const std::string &priv);
290
291 bool has_drop_policy(void);
292
293 bool has_executed_drop_policy(void);
294
295 void execute_drop_policy(void);
296
297 bool is_access_restricted_on_db(ulong want_access,
298 const std::string &db_name) const;
299
301
304
305 void set_thd(THD *thd);
306
307 THD *get_thd();
308
309 private:
310 void init();
311 void destroy();
312 void copy_security_ctx(const Security_context &src_sctx);
313 ulong filter_access(const ulong access, const std::string &db_name) const;
315 std::pair<bool, bool> fetch_global_grant(const ACL_USER &acl_user,
316 const std::string &privilege,
317 bool cumulative = false);
318 bool has_table_access(ulong priv, Table_ref *table);
319
320 private:
321 /**
322 m_user - user of the client, set to NULL until the user has been read from
323 the connection
324 */
326
327 /** m_host - host of the client */
329
330 /** m_ip - client IP */
332
333 /**
334 m_host_or_ip - points to host if host is available, otherwise points to ip
335 */
337
339
340 /**
341 m_priv_user - The user privilege we are using. May be "" for anonymous user.
342 */
345
348
349 /**
350 The host privilege we are using
351 */
354
355 /**
356 Global privileges from mysql.user.
357 */
359
360 /**
361 Privileges for current db
362 */
364
365 /**
366 password expiration flag.
367
368 This flag is set according to connecting user's context and not the
369 effective user.
370 */
374 /**
375 True if this account can't be logged into.
376 */
378 /**
379 True if the skip_grants_user is set.
380 */
382
387 /**
388 This flag tracks if server should be in sandbox mode or not.
389 When user account connects to server, with any of its authentication
390 plugin's registration step pending, in that case, the connection is
391 set in sandbox(or registration) mode i.e m_registration_sandbox_mode is set
392 to TRUE.
393 During this time only ALTER USER, SET PASSWORD statements are allowed.
394 Once user finishes the registration steps for the authentication plugin
395 via an ALTER USER statement, m_registration_sandbox_mode is set to FALSE,
396 making a full fledged connection, where user can execute any sql statement.
397 */
399
400 /**
401 m_thd - Thread handle, set to nullptr if this does not belong to any THD yet
402 */
404};
405
406/**
407 Getter method for member m_host_or_ip.
408
409 @retval LEX_CSTRING object having constant pointer to m_host_or_ip.Ptr
410 and its length
411*/
414
416
419
420 return host_or_ip;
421}
422
425
426 /*
427 Set host_or_ip to either host or ip if they are available else set it to
428 empty string.
429 */
430 const char *host_or_ip =
431 m_host.length() ? m_host.ptr() : (m_ip.length() ? m_ip.ptr() : "");
432
434}
435
437 const char *host_or_ip_arg, const int host_or_ip_arg_length) {
439
440 m_host_or_ip.set(host_or_ip_arg, host_or_ip_arg_length, system_charset_info);
441}
442
444 LEX_CSTRING ext_user;
445
447
448 ext_user.str = m_external_user.ptr();
449 ext_user.length = m_external_user.length();
450
451 return ext_user;
452}
453
454inline ulong Security_context::master_access() const { return m_master_access; }
455
457 return m_restrictions;
458}
459
460inline void Security_context::set_master_access(ulong master_access) {
463 DBUG_PRINT("info", ("Cached master access is %lu", m_master_access));
464}
465
467 ulong master_access, const Restrictions &restrictions) {
470}
471
472inline const char *Security_context::priv_host_name() const {
473 return (*m_priv_host ? m_priv_host : "%");
474}
475
477 return m_priv_host[0] != '\0';
478}
479
480inline ulong Security_context::current_db_access() const { return m_db_access; }
481
482inline void Security_context::cache_current_db_access(ulong db_access) {
483 m_db_access = db_access;
484}
485
487 return m_password_expired;
488}
489
490inline void Security_context::set_password_expired(bool password_expired) {
492}
493
496}
497
500}
501
504}
505
508}
509
510inline void Security_context::set_thd(THD *thd) { m_thd = thd; }
511
513
514#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:1064
Definition: sql_list.h:433
Container of all restrictions for a given user.
Definition: partial_revokes.h:117
void clear_db()
Clear database restrictions.
Definition: partial_revokes.cc:1482
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:53
bool user_matches(Security_context *)
Definition: sql_security_ctx.cc:310
String m_external_user
Definition: sql_security_ctx.h:338
ulong db_acl(LEX_CSTRING db, bool use_pattern_scan=true) const
Get grant information for given database.
Definition: sql_security_ctx.cc:497
bool has_table_access(ulong priv, Table_ref *table)
Check if required access to given table is granted.
Definition: sql_security_ctx.cc:1187
THD * get_thd()
Definition: sql_security_ctx.h:512
Grant_table_aggregate table_and_column_acls(LEX_CSTRING db, LEX_CSTRING table)
Definition: sql_security_ctx.cc:566
bool any_table_acl(const LEX_CSTRING &db)
Definition: sql_security_ctx.cc:614
void set_master_access(ulong master_access)
Definition: sql_security_ctx.h:460
String m_host
m_host - host of the client
Definition: sql_security_ctx.h:328
bool m_is_skip_grants_user
True if the skip_grants_user is set.
Definition: sql_security_ctx.h:381
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:385
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:482
const char * priv_host_name() const
Definition: sql_security_ctx.h:472
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:810
ulong function_acl(LEX_CSTRING db, LEX_CSTRING procedure_name)
Definition: sql_security_ctx.cc:548
void init()
Definition: sql_security_ctx.cc:77
LEX_CSTRING host() const
Getter method for member m_host.
Definition: sql_security_ctx.cc:848
LEX_CSTRING priv_user() const
Getter method for member m_priv_user.
Definition: sql_security_ctx.cc:776
void assign_user(const char *user_arg, const size_t user_arg_length)
Setter method for member m_user.
Definition: sql_security_ctx.cc:830
void copy_security_ctx(const Security_context &src_sctx)
Deep copy status of sctx object to this.
Definition: sql_security_ctx.cc:200
void set_password_expired(bool password_expired)
Definition: sql_security_ctx.h:490
void set_drop_policy(const std::function< void(Security_context *)> &func)
Definition: sql_security_ctx.cc:124
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:347
void set_registration_sandbox_mode(bool v)
Definition: sql_security_ctx.h:506
Restrictions m_restrictions
Definition: sql_security_ctx.h:386
char m_priv_user[USERNAME_LENGTH]
m_priv_user - The user privilege we are using.
Definition: sql_security_ctx.h:343
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:1124
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:1053
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:173
~Security_context()
Definition: sql_security_ctx.cc:58
void checkout_access_maps(void)
Subscribes to a cache entry of aggregated ACLs.
Definition: sql_security_ctx.cc:378
size_t get_num_active_roles() const
Definition: sql_security_ctx.cc:445
THD * m_thd
m_thd - Thread handle, set to nullptr if this does not belong to any THD yet
Definition: sql_security_ctx.h:403
char m_proxy_user[USERNAME_LENGTH+HOSTNAME_LENGTH+6]
Definition: sql_security_ctx.h:346
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:975
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:325
String m_ip
m_ip - client IP
Definition: sql_security_ctx.h:331
ulong m_db_access
Privileges for current db.
Definition: sql_security_ctx.h:363
bool any_sp_acl(const LEX_CSTRING &db)
Definition: sql_security_ctx.cc:599
ulong master_access() const
Getter method for member m_master_access.
Definition: sql_security_ctx.h:454
bool has_account_assigned() const
Check if a an account has been assigned to the security context.
Definition: sql_security_ctx.h:476
size_t m_proxy_user_length
Definition: sql_security_ctx.h:347
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:1264
LEX_CSTRING external_user() const
Getter method for member m_external_user.
Definition: sql_security_ctx.h:443
void assign_host(const char *host_arg, const size_t host_arg_length)
Setter method for member m_host.
Definition: sql_security_ctx.cc:891
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:868
bool m_is_locked
True if this account can't be logged into.
Definition: sql_security_ctx.h:377
bool is_in_registration_sandbox_mode()
Definition: sql_security_ctx.h:502
bool is_access_restricted_on_db(ulong want_access, const std::string &db_name) const
Definition: sql_security_ctx.cc:1109
bool m_password_expired
password expiration flag.
Definition: sql_security_ctx.h:371
size_t m_priv_user_length
Definition: sql_security_ctx.h:344
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:282
ulong procedure_acl(LEX_CSTRING db, LEX_CSTRING procedure_name)
Definition: sql_security_ctx.cc:530
Security_context(THD *thd=nullptr)
Definition: sql_security_ctx.cc:53
void execute_drop_policy(void)
Definition: sql_security_ctx.cc:117
void assign_ip(const char *ip_arg, const int ip_arg_length)
Setter method for member m_ip.
Definition: sql_security_ctx.cc:955
List_of_auth_id_refs * get_active_roles()
Definition: sql_security_ctx.cc:441
void init_restrictions(const Restrictions &restrictions)
Definition: sql_security_ctx.cc:1105
Acl_map * m_acl_map
Definition: sql_security_ctx.h:373
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:995
bool has_with_admin_acl(const LEX_CSTRING &role_name, const LEX_CSTRING &role_host)
Definition: sql_security_ctx.cc:585
bool password_expired() const
Getter method for member m_password_expired.
Definition: sql_security_ctx.h:486
LEX_CSTRING ip() const
Getter method for member m_ip.
Definition: sql_security_ctx.cc:915
char m_priv_host[HOSTNAME_LENGTH+1]
The host privilege we are using.
Definition: sql_security_ctx.h:352
size_t m_priv_host_length
Definition: sql_security_ctx.h:353
LEX_CSTRING priv_host() const
Getter method for member m_priv_host.
Definition: sql_security_ctx.cc:1073
ulong table_acl(LEX_CSTRING db, LEX_CSTRING table)
Definition: sql_security_ctx.cc:579
void set_host_or_ip_ptr()
Setter method for member m_host_or_ip.
Definition: sql_security_ctx.h:423
bool is_table_blocked(ulong priv, TABLE const *table)
Check if required access to given table is not restricted.
Definition: sql_security_ctx.cc:1231
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:319
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:1153
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:644
void set_thd(THD *thd)
Definition: sql_security_ctx.h:510
void destroy()
Definition: sql_security_ctx.cc:131
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:336
bool m_has_drop_policy
Definition: sql_security_ctx.h:384
LEX_CSTRING user() const
Getter method for member m_user.
Definition: sql_security_ctx.cc:790
void clear_db_restrictions()
Definition: sql_security_ctx.h:498
bool m_executed_drop_policy
Definition: sql_security_ctx.h:383
void logout()
Definition: sql_security_ctx.cc:98
void restore_security_context(THD *thd, Security_context *backup)
Definition: sql_security_ctx.cc:305
const Restrictions restrictions() const
Definition: sql_security_ctx.h:456
bool m_registration_sandbox_mode
This flag tracks if server should be in sandbox mode or not.
Definition: sql_security_ctx.h:398
void lock_account(bool is_locked)
Definition: sql_security_ctx.h:284
LEX_CSTRING host_or_ip() const
Getter method for member m_host_or_ip.
Definition: sql_security_ctx.h:412
bool is_skip_grants_user()
Definition: sql_security_ctx.h:494
ulong m_master_access
Global privileges from mysql.user.
Definition: sql_security_ctx.h:358
List_of_auth_id_refs m_active_roles
Definition: sql_security_ctx.h:372
bool has_executed_drop_policy(void)
Definition: sql_security_ctx.cc:113
bool has_drop_policy(void)
Definition: sql_security_ctx.cc:111
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:278
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:1015
ulong current_db_access() const
Returns the schema level effective privileges (with applied roles) for the currently active schema.
Definition: sql_security_ctx.h:480
void set_ip_ptr(const char *ip_arg, const int ip_arg_length)
Setter method for member m_ip.
Definition: sql_security_ctx.cc:935
Security_context & operator=(const Security_context &src_sctx)
Definition: sql_security_ctx.cc:65
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:738
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:422
LEX_CSTRING proxy_user() const
Getter method for member m_proxy_user.
Definition: sql_security_ctx.cc:1035
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:1091
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:33
Definition: table.h:2761
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1541
#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:194
Common definition between mysql server & client.
#define USERNAME_LENGTH
Definition: mysql_com.h:68
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:2436
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:1395
int is_locked(int fd)