MySQL 9.1.0
Source Code Documentation
|
INFORMATION SCHEMA innodb_trx, innodb_locks and innodb_lock_waits tables cache structures and public functions. More...
#include <optional>
#include "dict0types.h"
#include "lock0types.h"
#include "trx0types.h"
#include "univ.i"
Go to the source code of this file.
Classes | |
struct | i_s_locks_row_t |
This structure represents INFORMATION_SCHEMA.innodb_locks row. More... | |
struct | i_s_trx_row_t |
This structure represents INFORMATION_SCHEMA.innodb_trx row. More... | |
Macros | |
#define | TRX_I_S_STRING_COPY(data, field, constraint, tcache) |
Safely copy strings in to the INNODB_TRX table's string based columns. More... | |
Enumerations | |
enum | i_s_table { I_S_INNODB_TRX } |
Auxiliary enum used by functions that need to select one of the INFORMATION_SCHEMA tables. More... | |
Functions | |
void | trx_i_s_cache_init (trx_i_s_cache_t *cache) |
Initialize INFORMATION SCHEMA trx related cache. More... | |
void | trx_i_s_cache_free (trx_i_s_cache_t *cache) |
Free the INFORMATION SCHEMA trx related cache. More... | |
void | trx_i_s_cache_start_read (trx_i_s_cache_t *cache) |
Issue a shared/read lock on the tables cache. More... | |
void | trx_i_s_cache_end_read (trx_i_s_cache_t *cache) |
Release a shared/read lock on the tables cache. More... | |
void | trx_i_s_cache_start_write (trx_i_s_cache_t *cache) |
Issue an exclusive/write lock on the tables cache. More... | |
void | trx_i_s_cache_end_write (trx_i_s_cache_t *cache) |
Release an exclusive/write lock on the tables cache. More... | |
ulint | trx_i_s_cache_get_rows_used (trx_i_s_cache_t *cache, enum i_s_table table) |
Retrieves the number of used rows in the cache for a given INFORMATION SCHEMA table. More... | |
void * | trx_i_s_cache_get_nth_row (trx_i_s_cache_t *cache, enum i_s_table table, ulint n) |
Retrieves the nth row in the cache for a given INFORMATION SCHEMA table. More... | |
int | trx_i_s_possibly_fetch_data_into_cache (trx_i_s_cache_t *cache) |
Update the transactions cache if it has not been read for some time. More... | |
bool | trx_i_s_cache_is_truncated (trx_i_s_cache_t *cache) |
Returns true if the data in the cache is truncated due to the memory limit posed by TRX_I_S_MEM_LIMIT. More... | |
char * | trx_i_s_create_lock_id (const i_s_locks_row_t &row, char *lock_id, size_t lock_id_size) |
Crafts a lock id string from a i_s_locks_row_t object. More... | |
void | p_s_fill_lock_data (const char **lock_data, const lock_t *lock, ulint heap_no, PSI_server_data_lock_container *container) |
Fill performance schema lock data. More... | |
void | fill_locks_row (i_s_locks_row_t *row, const lock_t *lock, ulint heap_no) |
Fills i_s_locks_row_t object with data about the lock. More... | |
int | trx_i_s_parse_lock_id (const char *lock_id, i_s_locks_row_t *row) |
Parses lock id into row. More... | |
Variables | |
constexpr uint32_t | TRX_I_S_MEM_LIMIT = 16777216 |
The maximum amount of memory that can be consumed by innodb_trx, innodb_locks and innodb_lock_waits information schema tables. More... | |
constexpr uint32_t | TRX_I_S_LOCK_DATA_MAX_LEN = 8192 |
The maximum length of a string that can be stored in i_s_locks_row_t::lock_data. More... | |
constexpr uint32_t | TRX_I_S_TRX_QUERY_MAX_LEN = 1024 |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_query. More... | |
constexpr uint32_t | TRX_I_S_TRX_OP_STATE_MAX_LEN = 64 |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_operation_state. More... | |
constexpr uint32_t | TRX_I_S_TRX_FK_ERROR_MAX_LEN = 256 |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_foreign_key_error. More... | |
constexpr uint32_t | TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN = 16 |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_isolation_level. More... | |
trx_i_s_cache_t * | trx_i_s_cache |
This is the intermediate buffer where data needed to fill the INFORMATION SCHEMA tables is fetched and later retrieved by the C++ code in handler/i_s.cc. More... | |
constexpr uint32_t | TRX_I_S_LOCK_ID_MAX_LEN = 20 * 6 + 5 |
The maximum length of a resulting lock_id_size in trx_i_s_create_lock_id(), not including the terminating NUL. More... | |
INFORMATION SCHEMA innodb_trx, innodb_locks and innodb_lock_waits tables cache structures and public functions.
Created July 17, 2007 Vasil Dimov
#define TRX_I_S_STRING_COPY | ( | data, | |
field, | |||
constraint, | |||
tcache | |||
) |
Safely copy strings in to the INNODB_TRX table's string based columns.
enum i_s_table |
void fill_locks_row | ( | i_s_locks_row_t * | row, |
const lock_t * | lock, | ||
ulint | heap_no | ||
) |
Fills i_s_locks_row_t object with data about the lock.
[out] | row | Result object that's filled |
[in] | lock | Lock to get data from |
[in] | heap_no | Lock's record number or ULINT_UNDEFINED if the lock is a table lock |
void p_s_fill_lock_data | ( | const char ** | lock_data, |
const lock_t * | lock, | ||
ulint | heap_no, | ||
PSI_server_data_lock_container * | container | ||
) |
Fill performance schema lock data.
Create a string that represents the LOCK_DATA column, for a given lock record.
[out] | lock_data | Lock data string |
[in] | lock | Lock to inspect |
[in] | heap_no | Lock heap number |
[in] | container | Data container to fill |
void trx_i_s_cache_end_read | ( | trx_i_s_cache_t * | cache | ) |
Release a shared/read lock on the tables cache.
in: cache
cache | in: cache |
void trx_i_s_cache_end_write | ( | trx_i_s_cache_t * | cache | ) |
Release an exclusive/write lock on the tables cache.
in: cache
cache | in: cache |
void trx_i_s_cache_free | ( | trx_i_s_cache_t * | cache | ) |
Free the INFORMATION SCHEMA trx related cache.
in/out: cache to free
cache | in, own: cache to free |
void * trx_i_s_cache_get_nth_row | ( | trx_i_s_cache_t * | cache, |
enum i_s_table | table, | ||
ulint | n | ||
) |
Retrieves the nth row in the cache for a given INFORMATION SCHEMA table.
Retrieves the nth row in the cache for a given INFORMATION SCHEMA table.
cache | in: cache |
table | in: which table |
n | in: row number |
ulint trx_i_s_cache_get_rows_used | ( | trx_i_s_cache_t * | cache, |
enum i_s_table | table | ||
) |
Retrieves the number of used rows in the cache for a given INFORMATION SCHEMA table.
cache | in: cache |
table | in: which table |
void trx_i_s_cache_init | ( | trx_i_s_cache_t * | cache | ) |
Initialize INFORMATION SCHEMA trx related cache.
out: cache to init
cache | out: cache to init |
bool trx_i_s_cache_is_truncated | ( | trx_i_s_cache_t * | cache | ) |
Returns true if the data in the cache is truncated due to the memory limit posed by TRX_I_S_MEM_LIMIT.
[in] | cache | The cache |
void trx_i_s_cache_start_read | ( | trx_i_s_cache_t * | cache | ) |
Issue a shared/read lock on the tables cache.
in: cache
cache | in: cache |
void trx_i_s_cache_start_write | ( | trx_i_s_cache_t * | cache | ) |
Issue an exclusive/write lock on the tables cache.
in: cache
cache | in: cache |
char * trx_i_s_create_lock_id | ( | const i_s_locks_row_t & | row, |
char * | lock_id, | ||
size_t | lock_id_size | ||
) |
Crafts a lock id string from a i_s_locks_row_t object.
Returns its second argument. This function aborts if there is not enough space in lock_id. Be sure to provide at least TRX_I_S_LOCK_ID_MAX_LEN + 1 if you want to be 100% sure that it will not abort.
[in] | row | The description of the lock sufficient to populate a row |
[out] | lock_id | The buffer to store the resulting lock_id |
[in] | lock_id_size | The size of the lock_id buffer |
int trx_i_s_parse_lock_id | ( | const char * | lock_id, |
i_s_locks_row_t * | row | ||
) |
Parses lock id into row.
[in] | lock_id | Lock id generated with trx_i_s_create_lock_id |
[out] | row | Row to be filled in with data |
int trx_i_s_possibly_fetch_data_into_cache | ( | trx_i_s_cache_t * | cache | ) |
Update the transactions cache if it has not been read for some time.
Called from handler/i_s.cc.
cache | in/out: cache |
|
extern |
This is the intermediate buffer where data needed to fill the INFORMATION SCHEMA tables is fetched and later retrieved by the C++ code in handler/i_s.cc.
|
constexpr |
The maximum length of a string that can be stored in i_s_locks_row_t::lock_data.
|
constexpr |
The maximum length of a resulting lock_id_size in trx_i_s_create_lock_id(), not including the terminating NUL.
"%lu:%lu:%lu:%lu:%lu:%lu" -> 20*6+5 chars
|
constexpr |
The maximum amount of memory that can be consumed by innodb_trx, innodb_locks and innodb_lock_waits information schema tables.
|
constexpr |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_foreign_key_error.
|
constexpr |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_isolation_level.
|
constexpr |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_operation_state.
|
constexpr |
The maximum length of a string that can be stored in i_s_trx_row_t::trx_query.