MySQL 8.0.40
Source Code Documentation
|
#include "sql/auth/dynamic_privilege_table.h"
#include <string.h>
#include <memory>
#include <string>
#include "lex_string.h"
#include "m_ctype.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/components/my_service.h"
#include "mysql/components/service.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/components/services/dynamic_privilege.h"
#include "mysql/components/services/log_shared.h"
#include "mysql/components/services/registry.h"
#include "mysql/mysql_lex_string.h"
#include "mysql/service_plugin_registry.h"
#include "mysqld_error.h"
#include "sql/auth/auth_common.h"
#include "sql/auth/auth_internal.h"
#include "sql/auth/sql_auth_cache.h"
#include "sql/auth/sql_user_table.h"
#include "sql/current_thd.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/iterators/row_iterator.h"
#include "sql/key.h"
#include "sql/sql_const.h"
#include "sql/sql_executor.h"
#include "sql/table.h"
Macros | |
#define | MYSQL_DYNAMIC_PRIV_FIELD_USER 0 |
#define | MYSQL_DYNAMIC_PRIV_FIELD_HOST 1 |
#define | MYSQL_DYNAMIC_PRIV_FIELD_PRIV 2 |
#define | MYSQL_DYNAMIC_PRIV_FIELD_GRANT 3 |
Functions | |
Dynamic_privilege_register * | get_dynamic_privilege_register (void) |
This function returns a pointer to a global variable allocated on the heap. More... | |
bool | populate_dynamic_privilege_caches (THD *thd, Table_ref *tablelst) |
Given an open table handler this function refresh the list of dynamic privilege grants by reading the dynamic_privilege table. More... | |
bool | modify_dynamic_privileges_in_table (THD *thd, TABLE *table, const Auth_id_ref &auth_id, const LEX_CSTRING &privilege, bool with_grant_option, bool delete_option) |
Delete or insert a row in the mysql.dynamic_privilege table. More... | |
bool | iterate_all_dynamic_privileges (THD *thd, std::function< bool(const char *)> action) |
Variables | |
Dynamic_privilege_register | g_dynamic_privilege_register |
#define MYSQL_DYNAMIC_PRIV_FIELD_GRANT 3 |
#define MYSQL_DYNAMIC_PRIV_FIELD_HOST 1 |
#define MYSQL_DYNAMIC_PRIV_FIELD_PRIV 2 |
#define MYSQL_DYNAMIC_PRIV_FIELD_USER 0 |
Dynamic_privilege_register * get_dynamic_privilege_register | ( | void | ) |
This function returns a pointer to a global variable allocated on the heap.
bool iterate_all_dynamic_privileges | ( | THD * | thd, |
std::function< bool(const char *)> | action | ||
) |
bool modify_dynamic_privileges_in_table | ( | THD * | thd, |
TABLE * | table, | ||
const Auth_id_ref & | auth_id, | ||
const LEX_CSTRING & | privilege, | ||
bool | with_grant_option, | ||
bool | delete_option | ||
) |
Delete or insert a row in the mysql.dynamic_privilege table.
thd | Thread handler |
table | The opened table to be modified |
auth_id | Target authorization ID |
privilege | Privilege object ID |
with_grant_option | Flag indicating if the grant option is set |
delete_option | Flag indicating if this is an insert or delete |
If an error has occurred the DA is not set.
true | An error occurred |
false | Success |
Given an open table handler this function refresh the list of dynamic privilege grants by reading the dynamic_privilege table.
If an error is raised, this function will set the DA.
thd | The thread handle |
tablelst | An handle to an open table |
true | An error occurred. |
false | Success |
Dynamic_privilege_register g_dynamic_privilege_register |