MySQL 9.1.0
Source Code Documentation
lock_t Struct Reference

Lock struct; protected by lock_sys latches. More...

#include <lock0priv.h>

Public Member Functions

 UT_LIST_NODE_T (lock_t) trx_locks
 list of the locks of the transaction More...
 
void unlock_gap_lock ()
 Unlock the GAP Lock part of this Next Key Lock. More...
 
bool is_record_lock () const
 Determine if the lock object is a record lock. More...
 
bool is_predicate () const
 Determine if it is predicate lock. More...
 
bool is_waiting () const
 
bool is_gap () const
 
bool is_record_not_gap () const
 
bool is_next_key_lock () const
 
bool is_insert_intention () const
 
bool includes_supremum () const
 
uint32_t type () const
 
lock_mode mode () const
 
Locks_hashtablehash_table () const
 Get lock hash table. More...
 
trx_que_t trx_que_state () const
 
std::ostream & print (std::ostream &out) const
 Print the lock object into the given output stream. More...
 
std::string type_mode_string () const
 Convert the member 'type_mode' into a human readable string. More...
 
const char * type_string () const
 
Bitset< const bytebitset () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Bitset< bytebitset ()
 Gets access to the LOCK_REC's bitmap, which indicates heap_no-s, which are the subject of this lock request. More...
 

Public Attributes

trx_ttrx
 transaction owning the lock More...
 
dict_index_tindex
 Index for a record lock. More...
 
lock_thash
 Hash chain node for a record lock. More...
 
union {
   lock_table_t   tab_lock
 Table lock. More...
 
   lock_rec_t   rec_lock
 Record lock. More...
 
}; 
 
ulonglong m_psi_internal_thread_id
 Performance schema thread that created the lock. More...
 
ulonglong m_psi_event_id
 Performance schema event that created the lock. More...
 
uint32_t type_mode
 The lock type and mode bit flags. More...
 
uint64_t m_seq
 Timestamp when it was created. More...
 

Detailed Description

Lock struct; protected by lock_sys latches.

Member Function Documentation

◆ bitset() [1/2]

Bitset< byte > lock_t::bitset ( )
inline

Gets access to the LOCK_REC's bitmap, which indicates heap_no-s, which are the subject of this lock request.

This should be used directly only in the lock-sys code. Use lock_rec_bitmap_reset(), lock_rec_reset_nth_bit(), lock_rec_set_nth_bit(), and lock_rec_get_nth_bit() wrappers instead. In particular this bitset might be shorter than actual number of heap_no-s on the page!

◆ bitset() [2/2]

Bitset< const byte > lock_t::bitset ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ hash_table()

Locks_hashtable & lock_t::hash_table ( ) const
inline

Get lock hash table.

Returns
lock hash table

◆ includes_supremum()

bool lock_t::includes_supremum ( ) const
inline
Returns
true iff this lock is (at least) on supremum pseudo-record

◆ is_gap()

bool lock_t::is_gap ( ) const
inline
Returns
true if the gap lock bit is set

◆ is_insert_intention()

bool lock_t::is_insert_intention ( ) const
inline
Returns
true if the insert intention bit is set

◆ is_next_key_lock()

bool lock_t::is_next_key_lock ( ) const
inline
Returns
true iff the lock is a Next Key Lock

◆ is_predicate()

bool lock_t::is_predicate ( ) const
inline

Determine if it is predicate lock.

Returns
true if predicate lock, false otherwise.

◆ is_record_lock()

bool lock_t::is_record_lock ( ) const
inline

Determine if the lock object is a record lock.

Returns
true if record lock, false otherwise.

◆ is_record_not_gap()

bool lock_t::is_record_not_gap ( ) const
inline
Returns
true if the not gap lock bit is set

◆ is_waiting()

bool lock_t::is_waiting ( ) const
inline
Returns
true if the lock wait flag is set

◆ mode()

lock_mode lock_t::mode ( ) const
inline
Returns
the precise lock mode

◆ print()

std::ostream & lock_t::print ( std::ostream &  out) const
inline

Print the lock object into the given output stream.

Parameters
[in,out]outthe output stream
Returns
the given output stream.

◆ trx_que_state()

trx_que_t lock_t::trx_que_state ( ) const
inline
Returns
the transaction's query thread state.

◆ type()

uint32_t lock_t::type ( ) const
inline
Returns
the lock mode

◆ type_mode_string()

std::string lock_t::type_mode_string ( ) const
inline

Convert the member 'type_mode' into a human readable string.

Returns
human readable string

◆ type_string()

const char * lock_t::type_string ( ) const
inline

◆ unlock_gap_lock()

void lock_t::unlock_gap_lock ( )
inline

Unlock the GAP Lock part of this Next Key Lock.

◆ UT_LIST_NODE_T()

lock_t::UT_LIST_NODE_T ( lock_t  )

list of the locks of the transaction

Member Data Documentation

◆ 

union { ... } lock_t::@199

◆ hash

lock_t* lock_t::hash

Hash chain node for a record lock.

The link node in a singly linked list, used by the hash table.

◆ index

dict_index_t* lock_t::index

Index for a record lock.

◆ m_psi_event_id

ulonglong lock_t::m_psi_event_id

Performance schema event that created the lock.

◆ m_psi_internal_thread_id

ulonglong lock_t::m_psi_internal_thread_id

Performance schema thread that created the lock.

◆ m_seq

uint64_t lock_t::m_seq

Timestamp when it was created.

◆ rec_lock

lock_rec_t lock_t::rec_lock

Record lock.

◆ tab_lock

lock_table_t lock_t::tab_lock

Table lock.

◆ trx

trx_t* lock_t::trx

transaction owning the lock

◆ type_mode

uint32_t lock_t::type_mode

The lock type and mode bit flags.

LOCK_GAP or LOCK_REC_NOT_GAP, LOCK_INSERT_INTENTION, wait flag, ORed


The documentation for this struct was generated from the following file: