MySQL 8.0.31
Source Code Documentation
lock0priv.ic File Reference

Lock module internal inline methods. More...

Functions

static uint32_t lock_get_type_low (const lock_t *lock)
 Gets the type of a lock. More...
 
static trx_id_t lock_clust_rec_some_has_impl (const rec_t *rec, const dict_index_t *index, const ulint *offsets)
 
static uint32_t lock_rec_get_n_bits (const lock_t *lock)
 
static void lock_rec_set_nth_bit (lock_t *lock, ulint i)
 Sets the nth bit of a record lock to true. More...
 
static lock_tlock_rec_get_next_on_page (lock_t *lock)
 Gets the first or next record lock on a page. More...
 
static lock_tlock_rec_get_first_on_page_addr (hash_table_t *lock_hash, const page_id_t &page_id)
 
static lock_tlock_rec_get_first_on_page (hash_table_t *lock_hash, const buf_block_t *block)
 Gets the first record lock on a page, where the page is identified by a pointer to it. More...
 
static lock_tlock_rec_get_next (ulint heap_no, lock_t *lock)
 Gets the next explicit lock request on a record. More...
 
static const lock_tlock_rec_get_next_const (ulint heap_no, const lock_t *lock)
 Gets the next explicit lock request on a record. More...
 
static lock_tlock_rec_get_first (hash_table_t *hash, const buf_block_t *block, ulint heap_no)
 Gets the first explicit lock request on a record. More...
 
static bool lock_rec_get_nth_bit (const lock_t *lock, ulint i)
 Gets the nth bit of a record lock. More...
 
static const lock_tlock_rec_get_next_on_page_const (const lock_t *lock)
 Gets the first or next record lock on a page. More...
 
static enum lock_mode lock_get_mode (const lock_t *lock)
 Gets the mode of a lock. More...
 
static ulint lock_mode_compatible (enum lock_mode mode1, enum lock_mode mode2)
 Calculates if lock mode 1 is compatible with lock mode 2. More...
 
static bool lock_mode_stronger_or_eq (enum lock_mode mode1, enum lock_mode mode2)
 
static ulint lock_get_wait (const lock_t *lock)
 Gets the wait flag of a lock. More...
 
static void lock_reset_lock_and_trx_wait (lock_t *lock)
 The back pointer to a waiting lock request in the transaction is set to NULL and the wait bit in lock type_mode is reset. More...
 
static bool lock_table_has (const trx_t *trx, const dict_table_t *table, lock_mode in_mode)
 

Detailed Description

Lock module internal inline methods.

Created July 16, 2007 Vasil Dimov

Function Documentation

◆ lock_clust_rec_some_has_impl()

static trx_id_t lock_clust_rec_some_has_impl ( const rec_t rec,
const dict_index_t index,
const ulint offsets 
)
inlinestatic

◆ lock_get_mode()

static enum lock_mode lock_get_mode ( const lock_t lock)
inlinestatic

Gets the mode of a lock.

Returns
mode
Parameters
lockin: lock

◆ lock_get_type_low()

static uint32_t lock_get_type_low ( const lock_t lock)
inlinestatic

Gets the type of a lock.

Returns
LOCK_TABLE or LOCK_REC
Parameters
lockin: lock

◆ lock_get_wait()

static ulint lock_get_wait ( const lock_t lock)
inlinestatic

Gets the wait flag of a lock.

Returns
LOCK_WAIT if waiting, 0 if not
Parameters
lockin: lock

◆ lock_mode_compatible()

static ulint lock_mode_compatible ( enum lock_mode  mode1,
enum lock_mode  mode2 
)
inlinestatic

Calculates if lock mode 1 is compatible with lock mode 2.

Returns
nonzero if mode1 compatible with mode2
Parameters
mode1in: lock mode
mode2in: lock mode

◆ lock_mode_stronger_or_eq()

static bool lock_mode_stronger_or_eq ( enum lock_mode  mode1,
enum lock_mode  mode2 
)
inlinestatic

◆ lock_rec_get_first()

static lock_t * lock_rec_get_first ( hash_table_t hash,
const buf_block_t block,
ulint  heap_no 
)
inlinestatic

Gets the first explicit lock request on a record.

Returns
first lock, NULL if none exists
Parameters
hashin: hash chain the lock on
blockin: block containing the record
heap_noin: heap number of the record

◆ lock_rec_get_first_on_page()

static lock_t * lock_rec_get_first_on_page ( hash_table_t lock_hash,
const buf_block_t block 
)
inlinestatic

Gets the first record lock on a page, where the page is identified by a pointer to it.

Returns
first lock, NULL if none exists
Parameters
lock_hashin: lock hash table
blockin: buffer block

◆ lock_rec_get_first_on_page_addr()

static lock_t * lock_rec_get_first_on_page_addr ( hash_table_t lock_hash,
const page_id_t page_id 
)
inlinestatic

◆ lock_rec_get_n_bits()

static uint32_t lock_rec_get_n_bits ( const lock_t lock)
inlinestatic

◆ lock_rec_get_next()

static lock_t * lock_rec_get_next ( ulint  heap_no,
lock_t lock 
)
inlinestatic

Gets the next explicit lock request on a record.

Returns
next lock, NULL if none exists or if heap_no == ULINT_UNDEFINED
Parameters
heap_noin: heap number of the record
lockin: lock

◆ lock_rec_get_next_const()

static const lock_t * lock_rec_get_next_const ( ulint  heap_no,
const lock_t lock 
)
inlinestatic

Gets the next explicit lock request on a record.

Returns
next lock, NULL if none exists or if heap_no == ULINT_UNDEFINED
Parameters
heap_noin: heap number of the record
lockin: lock

◆ lock_rec_get_next_on_page()

static lock_t * lock_rec_get_next_on_page ( lock_t lock)
inlinestatic

Gets the first or next record lock on a page.

Returns
next lock, NULL if none exists
Parameters
lockin: a record lock

◆ lock_rec_get_next_on_page_const()

static const lock_t * lock_rec_get_next_on_page_const ( const lock_t lock)
inlinestatic

Gets the first or next record lock on a page.

Returns
next lock, NULL if none exists
Parameters
lockin: a record lock

◆ lock_rec_get_nth_bit()

static bool lock_rec_get_nth_bit ( const lock_t lock,
ulint  i 
)
inlinestatic

Gets the nth bit of a record lock.

Parameters
[in]lockRecord lock
[in]iIndex of the bit to check
Returns
true if bit set also if i == ULINT_UNDEFINED return false

◆ lock_rec_set_nth_bit()

static void lock_rec_set_nth_bit ( lock_t lock,
ulint  i 
)
inlinestatic

Sets the nth bit of a record lock to true.

Parameters
lockin: record lock
iin: index of the bit

◆ lock_reset_lock_and_trx_wait()

static void lock_reset_lock_and_trx_wait ( lock_t lock)
inlinestatic

The back pointer to a waiting lock request in the transaction is set to NULL and the wait bit in lock type_mode is reset.

Parameters
lockin/out: record lock

◆ lock_table_has()

static bool lock_table_has ( const trx_t trx,
const dict_table_t table,
lock_mode  in_mode 
)
inlinestatic