24#ifndef MYSQL_PSI_DATA_LOCK_H
25#define MYSQL_PSI_DATA_LOCK_H
42#ifdef HAVE_PSI_DATA_LOCK_INTERFACE
49#define PSI_DATA_LOCK_VERSION_1 1
56#define PSI_DATA_LOCK_VERSION_2 2
63#define PSI_CURRENT_DATA_LOCK_VERSION 1
65#ifndef USE_PSI_DATA_LOCK_2
66#ifndef USE_PSI_DATA_LOCK_1
68#define USE_PSI_DATA_LOCK_1
73#ifdef USE_PSI_DATA_LOCK_1
74#define HAVE_PSI_DATA_LOCK_1
77#ifdef USE_PSI_DATA_LOCK_2
78#define HAVE_PSI_DATA_LOCK_2
95#ifdef HAVE_PSI_DATA_LOCK_1
152 size_t length,
const char **cached_ptr,
153 size_t *cached_length) = 0;
170 size_t engine_lock_id_length) = 0;
199 size_t table_schema_length,
const char *
table_name,
200 size_t table_name_length,
201 const char *partition_name,
202 size_t partition_name_length,
203 const char *sub_partition_name,
204 size_t sub_partition_name_length) = 0;
208 const char *engine,
size_t engine_length,
const char *engine_lock_id,
209 size_t engine_lock_id_length,
ulonglong transaction_id,
211 size_t table_schema_length,
const char *
table_name,
212 size_t table_name_length,
const char *partition_name,
213 size_t partition_name_length,
const char *sub_partition_name,
214 size_t sub_partition_name_length,
const char *index_name,
215 size_t index_name_length,
const void *identity,
const char *
lock_mode,
216 const char *lock_type,
const char *lock_status,
217 const char *lock_data) = 0;
246 size_t engine_lock_id_length) = 0;
255 size_t engine_lock_id_length) = 0;
295 const char *engine,
size_t engine_length,
296 const char *requesting_engine_lock_id,
297 size_t requesting_engine_lock_id_length,
299 ulonglong requesting_event_id,
const void *requesting_identity,
300 const char *blocking_engine_lock_id,
301 size_t blocking_engine_lock_id_length,
ulonglong blocking_transaction_id,
303 const void *blocking_identity) = 0;
329 bool with_lock_data) = 0;
340 const char *engine_lock_id,
size_t engine_lock_id_length,
341 bool with_lock_data) = 0;
366 const char *requesting_engine_lock_id,
367 size_t requesting_engine_lock_id_length,
368 const char *blocking_engine_lock_id,
369 size_t blocking_engine_lock_id_length) = 0;
445#ifdef USE_PSI_DATA_LOCK_1
Engine interface, row lock inspector.
Definition: psi_data_lock.h:386
virtual PSI_engine_data_lock_iterator * create_data_lock_iterator()=0
Create a data lock iterator.
PSI_engine_data_lock_inspector()=default
virtual void destroy_data_lock_wait_iterator(PSI_engine_data_lock_wait_iterator *it)=0
Destroy a data lock wait iterator.
virtual ~PSI_engine_data_lock_inspector()=default
virtual PSI_engine_data_lock_wait_iterator * create_data_lock_wait_iterator()=0
Create a data lock wait iterator.
virtual void destroy_data_lock_iterator(PSI_engine_data_lock_iterator *it)=0
Destroy a data lock iterator.
Engine interface, row lock iterator.
Definition: psi_data_lock.h:317
PSI_engine_data_lock_iterator()=default
virtual ~PSI_engine_data_lock_iterator()=default
virtual bool fetch(PSI_server_data_lock_container *container, const char *engine_lock_id, size_t engine_lock_id_length, bool with_lock_data)=0
Fetch a given data lock.
virtual bool scan(PSI_server_data_lock_container *container, bool with_lock_data)=0
Scan for more data locks.
Definition: psi_data_lock.h:344
virtual ~PSI_engine_data_lock_wait_iterator()=default
virtual bool scan(PSI_server_data_lock_wait_container *container)=0
Scan for more data lock waits.
virtual bool fetch(PSI_server_data_lock_wait_container *container, const char *requesting_engine_lock_id, size_t requesting_engine_lock_id_length, const char *blocking_engine_lock_id, size_t blocking_engine_lock_id_length)=0
Fetch a given data lock wait.
PSI_engine_data_lock_wait_iterator()=default
Server interface, row lock container.
Definition: psi_data_lock.h:117
virtual bool accept_thread_id_event_id(ulonglong thread_id, ulonglong event_id)=0
Check if the container accepts data for a particular event.
virtual void add_lock_row(const char *engine, size_t engine_length, const char *engine_lock_id, size_t engine_lock_id_length, ulonglong transaction_id, ulonglong thread_id, ulonglong event_id, 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 *sub_partition_name, size_t sub_partition_name_length, const char *index_name, size_t index_name_length, const void *identity, const char *lock_mode, const char *lock_type, const char *lock_status, const char *lock_data)=0
Add a row to table performance_schema.data_locks.
virtual bool accept_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)=0
Check if the container accepts data for a particular lock.
virtual void cache_identifier(PSI_identifier kind, const char *str, size_t length, const char **cached_ptr, size_t *cached_length)=0
Add an identifier in the container cache.
virtual bool accept_transaction_id(ulonglong transaction_id)=0
Check if the container accepts data for a particular transaction.
PSI_server_data_lock_container()=default
virtual ~PSI_server_data_lock_container()=default
virtual const char * cache_data(const char *ptr, size_t length)=0
Add binary data to the container cache.
virtual bool accept_engine(const char *engine, size_t engine_length)=0
Check if the container accepts data for a particular engine.
virtual bool accept_object(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 *sub_partition_name, size_t sub_partition_name_length)=0
Check if the container accepts data for a particular object.
virtual const char * cache_string(const char *string)=0
Add a string to the container cache.
Definition: psi_data_lock.h:220
PSI_server_data_lock_wait_container()=default
virtual bool accept_requesting_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)=0
Check if the container accepts data for a particular requesting lock id.
virtual bool accept_blocking_thread_id_event_id(ulonglong thread_id, ulonglong event_id)=0
Check if the container accepts data for a particular blocking event.
virtual const char * cache_string(const char *string)=0
virtual bool accept_blocking_lock_id(const char *engine_lock_id, size_t engine_lock_id_length)=0
Check if the container accepts data for a particular blocking lock id.
virtual bool accept_engine(const char *engine, size_t engine_length)=0
Check if the container accepts data for a particular engine.
virtual bool accept_requesting_thread_id_event_id(ulonglong thread_id, ulonglong event_id)=0
Check if the container accepts data for a particular requesting event.
virtual ~PSI_server_data_lock_wait_container()=default
virtual bool accept_requesting_transaction_id(ulonglong transaction_id)=0
Check if the container accepts data for a particular requesting transaction id.
virtual bool accept_blocking_transaction_id(ulonglong transaction_id)=0
Check if the container accepts data for a particular blocking transaction id.
virtual const char * cache_data(const char *ptr, size_t length)=0
virtual void add_lock_wait_row(const char *engine, size_t engine_length, const char *requesting_engine_lock_id, size_t requesting_engine_lock_id_length, ulonglong requesting_transaction_id, ulonglong requesting_thread_id, ulonglong requesting_event_id, const void *requesting_identity, const char *blocking_engine_lock_id, size_t blocking_engine_lock_id_length, ulonglong blocking_transaction_id, ulonglong blocking_thread_id, ulonglong blocking_event_id, const void *blocking_identity)=0
Add a row to table performance_schema.data_lock_waits.
PSI_identifier
Definition: psi_data_lock.h:97
MYSQL_PLUGIN_IMPORT PSI_data_lock_service_t * psi_data_lock_service
Definition: psi_noop.cc:973
void(* register_data_lock_v1_t)(PSI_engine_data_lock_inspector *inspector)
Row Lock registration API.
Definition: psi_data_lock.h:424
void(* unregister_data_lock_v1_t)(PSI_engine_data_lock_inspector *inspector)
Row Lock un registration API.
Definition: psi_data_lock.h:430
@ PSI_IDENTIFIER_PARTITION
Definition: psi_data_lock.h:102
@ PSI_IDENTIFIER_NONE
Definition: psi_data_lock.h:98
@ PSI_IDENTIFIER_SCHEMA
Definition: psi_data_lock.h:99
@ PSI_IDENTIFIER_TABLE
Definition: psi_data_lock.h:100
@ PSI_IDENTIFIER_SUBPARTITION
Definition: psi_data_lock.h:103
@ PSI_IDENTIFIER_INDEX
Definition: psi_data_lock.h:101
lock_mode
Definition: lock0types.h:52
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
static my_thread_id thread_id
Definition: my_thr_init.cc:63
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: atomics_array.h:39
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
const char * table_name
Definition: rules_table_service.cc:56
required uint64 version
Definition: replication_group_member_actions.proto:41
Entry point for the performance schema interface.
Definition: psi_data_lock.h:82
Performance Schema Row Lock Interface, version 1.
Definition: psi_data_lock.h:437
register_data_lock_v1_t register_data_lock
Definition: psi_data_lock.h:438
unregister_data_lock_v1_t unregister_data_lock
Definition: psi_data_lock.h:439
Definition: psi_bits.h:165