MySQL 8.4.3
Source Code Documentation
Global_read_lock Class Reference

An instance of the global read lock in a connection. More...

#include <sql_class.h>

Public Types

enum  enum_grl_state { GRL_NONE , GRL_ACQUIRED , GRL_ACQUIRED_AND_BLOCKS_COMMIT }
 

Public Member Functions

 Global_read_lock ()
 
bool lock_global_read_lock (THD *thd)
 Take global read lock, wait if there is protection against lock. More...
 
void unlock_global_read_lock (THD *thd)
 Unlock global read lock. More...
 
bool can_acquire_protection () const
 Check if this connection can acquire protection against GRL and emit error if otherwise. More...
 
bool make_global_read_lock_block_commit (THD *thd)
 Make global read lock also block commits. More...
 
bool is_acquired () const
 
void set_explicit_lock_duration (THD *thd)
 Set explicit duration for metadata locks which are used to implement GRL. More...
 

Private Attributes

enum_grl_state m_state
 
MDL_ticketm_mdl_global_shared_lock
 In order to acquire the global read lock, the connection must acquire shared metadata lock in GLOBAL namespace, to prohibit all DDL. More...
 
MDL_ticketm_mdl_blocks_commits_lock
 Also in order to acquire the global read lock, the connection must acquire a shared metadata lock in COMMIT namespace, to prohibit commits. More...
 

Detailed Description

An instance of the global read lock in a connection.

Implemented in lock.cc.

Member Enumeration Documentation

◆ enum_grl_state

Enumerator
GRL_NONE 
GRL_ACQUIRED 
GRL_ACQUIRED_AND_BLOCKS_COMMIT 

Constructor & Destructor Documentation

◆ Global_read_lock()

Global_read_lock::Global_read_lock ( )
inline

Member Function Documentation

◆ can_acquire_protection()

bool Global_read_lock::can_acquire_protection ( ) const
inline

Check if this connection can acquire protection against GRL and emit error if otherwise.

◆ is_acquired()

bool Global_read_lock::is_acquired ( ) const
inline

Member Data Documentation

◆ m_mdl_blocks_commits_lock

MDL_ticket* Global_read_lock::m_mdl_blocks_commits_lock
private

Also in order to acquire the global read lock, the connection must acquire a shared metadata lock in COMMIT namespace, to prohibit commits.

◆ m_mdl_global_shared_lock

MDL_ticket* Global_read_lock::m_mdl_global_shared_lock
private

In order to acquire the global read lock, the connection must acquire shared metadata lock in GLOBAL namespace, to prohibit all DDL.

◆ m_state

enum_grl_state Global_read_lock::m_state
private

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