MySQL 9.1.0
Source Code Documentation
p_s.cc File Reference

InnoDB performance_schema tables interface to MySQL. More...

#include "storage/innobase/handler/p_s.h"
#include <type_traits>
#include "dict0dd.h"
#include "lock0iter.h"
#include "lock0lock.h"
#include "sql_table.h"
#include "trx0i_s.h"

Classes

struct  anonymous_namespace{p_s.cc}::parsed_table_path
 
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...
 

Namespaces

namespace  anonymous_namespace{p_s.cc}
 

Functions

template<typename F >
static void find_lock_and_execute (const char *engine_lock_id, F &&f)
 Searches for the lock_t object which has the specified engine_lock_id (. More...
 
std::string_view anonymous_namespace{p_s.cc}::alloc_identifier (PSI_server_data_lock_container *container, PSI_identifier kind, const std::string &id_str)
 Allocate identifier in performance schema container. More...
 
parsed_table_path anonymous_namespace{p_s.cc}::parse_table_path (PSI_server_data_lock_container *container, const char *table_path)
 Parse a table path string. More...
 
static void print_table_lock_id (const lock_t &lock, char *lock_id, size_t lock_id_size)
 Print a table lock id. More...
 
static 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...
 
static void print_lock_id (const lock_t &lock, ulint heap_no, char *lock_id, size_t lock_id_size)
 Print a lock id. More...
 

Variables

static const char * g_engine = "INNODB"
 
static const size_t g_engine_length = 6
 

Detailed Description

InnoDB performance_schema tables interface to MySQL.

Function Documentation

◆ find_lock_and_execute()

template<typename F >
static void find_lock_and_execute ( const char *  engine_lock_id,
F &&  f 
)
static

Searches for the lock_t object which has the specified engine_lock_id (.

See also
print_lock_id), and if it exists, executes provided f on it, under protection of shard-specific latch. The type of the lock (LOCK_REC or LOCK_TABLE) is also provided to f. For LOCK_REC multiple lock requests can share the same lock_t object, thus f will be fed the specific heap_no. For LOCK_TABLE this third argument will be always ULINT_UNDEFINED.
Parameters
[in]engine_lock_idThe string used in ENGINE_LOCK_ID column to uniquely identify the lock request.
[in]fA callable, for which f(lock, type, heap_no) will be executed, if lock with specified engine_lock_id exists.

◆ print_lock_id()

static void print_lock_id ( const lock_t lock,
ulint  heap_no,
char *  lock_id,
size_t  lock_id_size 
)
static

Print a lock id.

Parameters
[in]lockThe lock to print
[in]heap_noLock heap number if lock's type is LOCK_REC, ignored otherwise.
[in,out]lock_idPrinting buffer
[in]lock_id_sizePrinting buffer length

◆ print_record_lock_id()

static void print_record_lock_id ( const lock_t lock,
ulint  heap_no,
char *  lock_id,
size_t  lock_id_size 
)
static

Print a record lock id.

Parameters
[in]lockThe lock to print
[in]heap_noLock heap number
[in,out]lock_idPrinting buffer
[in]lock_id_sizePrinting buffer length

◆ print_table_lock_id()

static void print_table_lock_id ( const lock_t lock,
char *  lock_id,
size_t  lock_id_size 
)
static

Print a table lock id.

Parameters
[in]lockThe lock to print
[in,out]lock_idPrinting buffer
[in]lock_id_sizePrinting buffer length

Variable Documentation

◆ g_engine

const char* g_engine = "INNODB"
static

◆ g_engine_length

const size_t g_engine_length = 6
static