MySQL 9.0.0
Source Code Documentation

Server interface, row lock container. More...

#include <psi_data_lock.h>

Inheritance diagram for PSI_server_data_lock_container:
[legend]

Public Member Functions

 PSI_server_data_lock_container ()=default
 
virtual ~PSI_server_data_lock_container ()=default
 
virtual const char * cache_string (const char *string)=0
 Add a string to the container cache. More...
 
virtual const char * cache_data (const char *ptr, size_t length)=0
 Add binary data to the container cache. More...
 
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. More...
 
virtual bool accept_engine (const char *engine, size_t engine_length)=0
 Check if the container accepts data for a particular engine. More...
 
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. More...
 
virtual bool accept_transaction_id (ulonglong transaction_id)=0
 Check if the container accepts data for a particular transaction. More...
 
virtual bool accept_thread_id_event_id (ulonglong thread_id, ulonglong event_id)=0
 Check if the container accepts data for a particular event. More...
 
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. More...
 
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. More...
 

Detailed Description

Server interface, row lock container.

This is the interface exposed

  • by the server
  • to the storage engines used to collect the data for table DATA_LOCKS. The server is to implement this interface. The storage engine is to call all_lock_row() to advertise row locks that exists within the storage engine tables.

Constructor & Destructor Documentation

◆ PSI_server_data_lock_container()

PSI_server_data_lock_container::PSI_server_data_lock_container ( )
default

◆ ~PSI_server_data_lock_container()

virtual PSI_server_data_lock_container::~PSI_server_data_lock_container ( )
virtualdefault

Member Function Documentation

◆ accept_engine()

virtual bool PSI_server_data_lock_container::accept_engine ( const char *  engine,
size_t  engine_length 
)
pure virtual

Check if the container accepts data for a particular engine.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE ENGINE = ...
const std::string SELECT("SELECT")
Name of the static privileges.
@ WHERE
Definition: sql_yacc.h:687

Implemented in PFS_data_lock_container.

◆ accept_lock_id()

virtual bool PSI_server_data_lock_container::accept_lock_id ( const char *  engine_lock_id,
size_t  engine_lock_id_length 
)
pure virtual

Check if the container accepts data for a particular lock.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE ENGINE_LOCK_ID = ...

Implemented in PFS_data_lock_container.

◆ accept_object()

virtual bool PSI_server_data_lock_container::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 
)
pure virtual

Check if the container accepts data for a particular object.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks
WHERE OBJECT_SCHEMA = ...
AND OBJECT_NAME = ...
AND PARTITION_NAME = ...
AND SUBPARTITION_NAME = ...

Implemented in PFS_data_lock_container.

◆ accept_thread_id_event_id()

virtual bool PSI_server_data_lock_container::accept_thread_id_event_id ( ulonglong  thread_id,
ulonglong  event_id 
)
pure virtual

Check if the container accepts data for a particular event.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks
WHERE THREAD_ID = ... AND EVENT_ID = ...

Implemented in PFS_data_lock_container.

◆ accept_transaction_id()

virtual bool PSI_server_data_lock_container::accept_transaction_id ( ulonglong  transaction_id)
pure virtual

Check if the container accepts data for a particular transaction.

This methods is used to prune data for queries like

SELECT * from performance_schema.data_locks WHERE
ENGINE_TRANSACTION_ID = ...

Implemented in PFS_data_lock_container.

◆ add_lock_row()

virtual void PSI_server_data_lock_container::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 
)
pure virtual

Add a row to table performance_schema.data_locks.

Implemented in PFS_data_lock_container.

◆ cache_data()

virtual const char * PSI_server_data_lock_container::cache_data ( const char *  ptr,
size_t  length 
)
pure virtual

Add binary data to the container cache.

See also
cache_string

Implemented in PFS_data_lock_container.

◆ cache_identifier()

virtual void PSI_server_data_lock_container::cache_identifier ( PSI_identifier  kind,
const char *  str,
size_t  length,
const char **  cached_ptr,
size_t *  cached_length 
)
pure virtual

Add an identifier in the container cache.

Depending on the identifier kind, the string given may be normalized, to comply with lower_case_table_names, before adding the string into the cache. Beware that the normalized string length may differ from the input string length.

Parameters
[in]kindIdentifier kind, used for string normalization
[in]strIdentifier input string
[in]lengthIdentifier input string length
[out]cached_ptrCached, possibly normalized, identifier string
[out]cached_lengthCached identifier string length

Implemented in PFS_data_lock_container.

◆ cache_string()

virtual const char * PSI_server_data_lock_container::cache_string ( const char *  string)
pure virtual

Add a string to the container cache.

Cached strings have the same life cycle as the data container, and are freed when the container is destroyed. Also, duplicated strings value are cached with the same copy, avoiding memory duplication. This is useful in particular to cache table schema or table names, which are duplicated a lot for different row locks on the same table.

Implemented in PFS_data_lock_container.


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