MySQL 9.0.0
Source Code Documentation
|
InnoDB performance_schema tables interface to MySQL. More...
#include "storage/innobase/handler/p_s.h"
#include <stdlib.h>
#include <sys/types.h>
#include <type_traits>
#include "lock0iter.h"
#include "lock0lock.h"
#include "sql_table.h"
#include "table.h"
#include "trx0i_s.h"
#include "trx0sys.h"
#include <algorithm>
#include <array>
#include <limits>
#include "my_io.h"
Classes | |
class | Max_of_n_smallest< N, Element > |
class | Innodb_trx_scan_state |
State of a given scan. More... | |
class | Innodb_data_lock_iterator |
Inspect data locks for the innodb storage engine. More... | |
class | Innodb_data_lock_wait_iterator |
Inspect data lock waits for the innodb storage engine. More... | |
Enumerations | |
enum | scan_pass { INIT_SCANNING , SCANNING_RW_TRX_LIST , SCANNING_MYSQL_TRX_LIST , DONE_SCANNING } |
Pass of a given scan. More... | |
Functions | |
bool | discard_trx (const trx_t *trx, bool read_write) |
Check if a transaction should be discarded. More... | |
template<typename Trx_list > | |
static constexpr bool | is_read_write () |
template<typename Trx_list > | |
static const trx_t * | fetch_trx_in_trx_list (uint64_t filter_trx_immutable_id, Trx_list *trx_list) |
Find a transaction in a TRX LIST. More... | |
void | alloc_identifier (PSI_server_data_lock_container *container, PSI_identifier kind, const std::string &id_str, const char **cached_id, size_t *cached_id_length) |
Allocate identifier in performance schema container. More... | |
void | parse_table_path (PSI_server_data_lock_container *container, const char *table_path, const char **table_schema, size_t *table_schema_length, const char **table_name, size_t *table_name_length, const char **partition_name, size_t *partition_name_length, const char **subpartition_name, size_t *subpartition_name_length) |
Parse a table path string. More... | |
void | print_table_lock_id (const lock_t *lock, char *lock_id, size_t lock_id_size) |
Print a table lock id. More... | |
void | print_record_lock_id (const lock_t *lock, ulint heap_no, char *lock_id, size_t lock_id_size) |
Print a record lock id. More... | |
void | print_lock_id (const lock_t *lock, ulint heap_no, char *lock_id, size_t lock_id_size) |
Print a lock id. More... | |
int | scan_lock_id (const char *lock_id, uint64_t *trx_immutable_id, uint64_t *lock_immutable_id, ulint *heap_id) |
Scan a lock id string and extract information necessary to find a row by primary key. More... | |
Variables | |
static const char * | g_engine = "INNODB" |
static const size_t | g_engine_length = 6 |
InnoDB performance_schema tables interface to MySQL.
enum scan_pass |
void alloc_identifier | ( | PSI_server_data_lock_container * | container, |
PSI_identifier | kind, | ||
const std::string & | id_str, | ||
const char ** | cached_id, | ||
size_t * | cached_id_length | ||
) |
Allocate identifier in performance schema container.
[in] | container | The container to fill |
[in] | kind | The identifier kind |
[in] | id_str | The identifier string |
[out] | cached_id | The cached identifier string |
[out] | cached_id_length | The cached identifier string length |
bool discard_trx | ( | const trx_t * | trx, |
bool | read_write | ||
) |
Check if a transaction should be discarded.
Transactions present in any TRX LIST that have not started yet are discarded, when inspecting data locks. Transactions present in the MySQL TRX LIST, that are writing data and have an id, are also discarded.
[in] | trx | Transaction to evaluate |
[in] | read_write | True if trx is in the RW TRX list |
|
static |
Find a transaction in a TRX LIST.
[in] | filter_trx_immutable_id | The transaction immutable id |
[in] | trx_list | The transaction list |
|
staticconstexpr |
void parse_table_path | ( | PSI_server_data_lock_container * | container, |
const char * | table_path, | ||
const char ** | table_schema, | ||
size_t * | table_schema_length, | ||
const char ** | table_name, | ||
size_t * | table_name_length, | ||
const char ** | partition_name, | ||
size_t * | partition_name_length, | ||
const char ** | subpartition_name, | ||
size_t * | subpartition_name_length | ||
) |
Parse a table path string.
Isolate the table schema, name, partition and sub partition from a table path string. Convert these strings and store them in the performance schema container.
[in] | container | The container to fill |
[in] | table_path | The table path string |
[out] | table_schema | The table schema |
[out] | table_schema_length | The table schema length |
[out] | table_name | The table name |
[out] | table_name_length | The table name length |
[out] | partition_name | Partition name |
[out] | partition_name_length | Partition name length |
[out] | subpartition_name | Sub partition name |
[out] | subpartition_name_length | Sub partition name length |
Print a lock id.
[in] | lock | The lock to print |
[in] | heap_no | Lock heap number |
[in,out] | lock_id | Printing buffer |
[in] | lock_id_size | Printing buffer length |
void print_record_lock_id | ( | const lock_t * | lock, |
ulint | heap_no, | ||
char * | lock_id, | ||
size_t | lock_id_size | ||
) |
Print a record lock id.
[in] | lock | The lock to print |
[in] | heap_no | Lock heap number |
[in,out] | lock_id | Printing buffer |
[in] | lock_id_size | Printing buffer length |
void print_table_lock_id | ( | const lock_t * | lock, |
char * | lock_id, | ||
size_t | lock_id_size | ||
) |
Print a table lock id.
[in] | lock | The lock to print |
[in,out] | lock_id | Printing buffer |
[in] | lock_id_size | Printing buffer length |
int scan_lock_id | ( | const char * | lock_id, |
uint64_t * | trx_immutable_id, | ||
uint64_t * | lock_immutable_id, | ||
ulint * | heap_id | ||
) |
Scan a lock id string and extract information necessary to find a row by primary key.
[in] | lock_id | The lock id string to parse |
[out] | trx_immutable_id | The immutable id of lock->trx |
[out] | lock_immutable_id | The immutable id of lock |
[out] | heap_id | The heap number found, for record locks |
LOCK_TABLE | Table lock |
LOCK_REC | Record lock |
0 | Format error |
|
static |
|
static |