MySQL 8.0.39
Source Code Documentation
i_s_locks_row_t Struct Reference

This structure represents INFORMATION_SCHEMA.innodb_locks row. More...

#include <trx0i_s.h>

Public Attributes

uint64_t lock_trx_immutable_id
 transaction address as integer. More...
 
uint64_t lock_immutable_id
 lock address as integer. More...
 
space_id_t lock_space
 Information for record locks. More...
 
page_no_t lock_page
 page number within the_space More...
 
ulint lock_rec
 heap number of the record on the page More...
 
table_id_t lock_table_id
 The following are auxiliary and not included in the table. More...
 

Detailed Description

This structure represents INFORMATION_SCHEMA.innodb_locks row.

Member Data Documentation

◆ lock_immutable_id

uint64_t i_s_locks_row_t::lock_immutable_id

lock address as integer.

We need to identify the lock in unique way. Specifying space, page and heap_no and trx is not enough, because there could be locks with different modes. Using mode as part of id is not good, because we sometimes change the mode of the lock (for example when granting the lock we drop LOCK_WAITING flag and in lock_trx_release_read_locks we add LOCK_REC_NOT_GAP flag). The only permanent thing is then the address. We use both lock_immutable_id and lock_trx_immutable_id even though lock_immutable_id is unique, because we need to be able to locate the row in PERFORMANCE_SCHEMA based on the id, and we need a way to verify that the lock_immutable_id is safe to dereference. Simplest way to do that is to check that trx still has the lock on its list of locks.

◆ lock_page

page_no_t i_s_locks_row_t::lock_page

page number within the_space

◆ lock_rec

ulint i_s_locks_row_t::lock_rec

heap number of the record on the page

◆ lock_space

space_id_t i_s_locks_row_t::lock_space

Information for record locks.

All these are ULINT_UNDEFINED for table locks. tablespace identifier

◆ lock_table_id

table_id_t i_s_locks_row_t::lock_table_id

The following are auxiliary and not included in the table.

table identifier from lock_get_table_id

◆ lock_trx_immutable_id

uint64_t i_s_locks_row_t::lock_trx_immutable_id

transaction address as integer.

We need an id which is unique and does not change over time. Unfortunately trx->id is initially equal to 0 for all trxs which still appear to be read only, and it changes to non-zero, once trx needs to perform write. For this reason trx->id is not good enough for our purpose.


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