MySQL  8.0.21
Source Code Documentation
dynamic_privilege_table.h File Reference
#include <functional>
#include <string>
#include <unordered_set>
#include "lex_string.h"
#include "sql/auth/auth_common.h"

Go to the source code of this file.

Classes

class  Update_dynamic_privilege_table
 

Typedefs

typedef std::unordered_set< std::string > Dynamic_privilege_register
 

Functions

bool populate_dynamic_privilege_caches (THD *thd, TABLE_LIST *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...
 
Dynamic_privilege_registerget_dynamic_privilege_register (void)
 This function returns a pointer to a global variable allocated on the heap. More...
 
void register_dynamic_privilege_impl (const std::string &priv)
 
bool iterate_all_dynamic_privileges (THD *thd, std::function< bool(const char *)> action)
 

Typedef Documentation

◆ Dynamic_privilege_register

typedef std::unordered_set<std::string> Dynamic_privilege_register

Function Documentation

◆ get_dynamic_privilege_register()

Dynamic_privilege_register* get_dynamic_privilege_register ( void  )

This function returns a pointer to a global variable allocated on the heap.

Returns
A pointer to the dynamic privilege register.

◆ iterate_all_dynamic_privileges()

bool iterate_all_dynamic_privileges ( THD thd,
std::function< bool(const char *)>  action 
)

◆ modify_dynamic_privileges_in_table()

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.

Parameters
thdThread handler
tableThe opened table to be modified
auth_idTarget authorization ID
privilegePrivilege object ID
with_grant_optionFlag indicating if the grant option is set
delete_optionFlag indicating if this is an insert or delete

If an error has occurred the DA is not set.

See also
Update_dynamic_privilege_table
Returns
Error state
Return values
trueAn error occurred
falseSuccess

◆ populate_dynamic_privilege_caches()

bool populate_dynamic_privilege_caches ( THD thd,
TABLE_LIST tablelst 
)

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.

Parameters
thdThe thread handle
tablelstAn handle to an open table
Returns
Error state
Return values
trueAn error occurred.
falseSuccess

◆ register_dynamic_privilege_impl()

void register_dynamic_privilege_impl ( const std::string &  priv)