MySQL  8.0.20
Source Code Documentation
Acl_restrictions Class Reference

Cache to store the Restrictions of every auth_id. More...

#include <sql_auth_cache.h>

Public Member Functions

 Acl_restrictions ()
 Construstor. More...
 
 Acl_restrictions (const Acl_restrictions &)=delete
 
 Acl_restrictions (Acl_restrictions &&)=delete
 
Acl_restrictionsoperator= (const Acl_restrictions &)=delete
 
Acl_restrictionsoperator= (Acl_restrictions &&)=delete
 
void remove_restrictions (const ACL_USER *acl_user)
 Remove the Restrictions of the ACL_USER. More...
 
void upsert_restrictions (const ACL_USER *acl_user, const Restrictions &restriction)
 Update, insert or remove the Restrictions for the ACL_USER. More...
 
Restrictions find_restrictions (const ACL_USER *acl_user) const
 Find the Restrictions of the ACL_USER. More...
 
size_t size () const
 

Private Attributes

malloc_unordered_map< std::string, Restrictionsm_restrictions_map
 

Detailed Description

Cache to store the Restrictions of every auth_id.

This cache is not thread safe. Callers must acquire acl_cache_write_lock before to amend the cache. Callers should acquire acl_cache_read_lock to probe the cache.

Acl_restrictions is not part of ACL_USER because as of now latter is POD type class. We use copy-POD for ACL_USER that makes the explicit memory management of its members hard.

Constructor & Destructor Documentation

◆ Acl_restrictions() [1/3]

Acl_restrictions::Acl_restrictions ( )

Construstor.

◆ Acl_restrictions() [2/3]

Acl_restrictions::Acl_restrictions ( const Acl_restrictions )
delete

◆ Acl_restrictions() [3/3]

Acl_restrictions::Acl_restrictions ( Acl_restrictions &&  )
delete

Member Function Documentation

◆ find_restrictions()

Restrictions Acl_restrictions::find_restrictions ( const ACL_USER acl_user) const

Find the Restrictions of the ACL_USER.

Parameters
[in]acl_userThe ACL_USER for whom to find the Restrictions
Returns
valid Restrictions if found otherwise empty Restrictions

◆ operator=() [1/2]

Acl_restrictions& Acl_restrictions::operator= ( const Acl_restrictions )
delete

◆ operator=() [2/2]

Acl_restrictions& Acl_restrictions::operator= ( Acl_restrictions &&  )
delete

◆ remove_restrictions()

void Acl_restrictions::remove_restrictions ( const ACL_USER acl_user)

Remove the Restrictions of the ACL_USER.

Parameters
[in]acl_userThe ACL_USER for whom to remove the Restrictions

◆ size()

size_t Acl_restrictions::size ( ) const
Returns
the number of Restrictions present. It is not thread safe method.

◆ upsert_restrictions()

void Acl_restrictions::upsert_restrictions ( const ACL_USER acl_user,
const Restrictions restrictions 
)

Update, insert or remove the Restrictions for the ACL_USER.

If ACL_USER has a Restrictions

  • If specified Restrictions is not empty then update ACL_USER's Restrictions
  • Otherwise clear the ACL_USER's restriction Else if there no Restrictions for the ACL_USER then insert the specified Restrictions.
Parameters
[in]acl_userThe ACL_USER for whom to alter the Restrictions
[in]restrictionsRestrictions to be inserted for the ACL_USER

Member Data Documentation

◆ m_restrictions_map

malloc_unordered_map<std::string, Restrictions> Acl_restrictions::m_restrictions_map
private

The documentation for this class was generated from the following files: