MySQL 8.4.0
Source Code Documentation
pfs_plugin_table_service.h File Reference

Go to the source code of this file.

Classes

struct  PFS_string
 
struct  PSI_long
 
struct  PSI_ulong
 
struct  PSI_longlong
 
struct  PSI_ulonglong
 
struct  PSI_double
 
struct  PSI_plugin_key_integer
 A structure to denote a key of type long in an index. More...
 
struct  PSI_plugin_key_uinteger
 A structure to denote a key of type ulong in an index. More...
 
struct  PSI_plugin_key_bigint
 A structure to denote a key of type long long in an index. More...
 
struct  PSI_plugin_key_ubigint
 A structure to denote a key of type unsigned long long in an index. More...
 
struct  PSI_plugin_key_string
 A structure to denote a key of type string in an index. More...
 
struct  PFS_engine_table_proxy
 A structure to keep callback functions to be implemented by plugin/component. More...
 
struct  PFS_engine_table_share_proxy
 A share to be initialized by plugin/component code and to be provided to add_table() service method of pfs_plugin_table_v1 service. More...
 
struct  s_mysql_pfs_plugin_table_v1
 Definition of pfs_plugin_table_v1 service and its methods. More...
 
struct  s_mysql_pfs_plugin_column_tiny_v1
 
struct  s_mysql_pfs_plugin_column_small_v1
 
struct  s_mysql_pfs_plugin_column_medium_v1
 
struct  s_mysql_pfs_plugin_column_integer_v1
 
struct  s_mysql_pfs_plugin_column_bigint_v1
 
struct  s_mysql_pfs_plugin_column_decimal_v1
 
struct  s_mysql_pfs_plugin_column_float_v1
 
struct  s_mysql_pfs_plugin_column_double_v1
 
struct  s_mysql_pfs_plugin_column_string_v2
 
struct  s_mysql_pfs_plugin_column_blob_v1
 
struct  s_mysql_pfs_plugin_column_enum_v1
 
struct  s_mysql_pfs_plugin_column_date_v1
 
struct  s_mysql_pfs_plugin_column_time_v1
 
struct  s_mysql_pfs_plugin_column_datetime_v1
 
struct  s_mysql_pfs_plugin_column_timestamp_v1
 
struct  s_mysql_pfs_plugin_column_timestamp_v2
 
struct  s_mysql_pfs_plugin_column_year_v1
 
struct  s_mysql_pfs_plugin_column_text_v1
 

Macros

#define PFS_HA_ERR_WRONG_COMMAND   131
 
#define PFS_HA_ERR_RECORD_DELETED   134
 
#define PFS_HA_ERR_END_OF_FILE   137
 
#define PFS_HA_ERR_NO_REFERENCED_ROW   151
 
#define PFS_HA_ERR_FOUND_DUPP_KEY   121
 
#define PFS_HA_ERR_RECORD_FILE_FULL   135
 
#define PSI_tinyint   PSI_long
 
#define PSI_utinyint   PSI_ulong
 
#define PSI_smallint   PSI_long
 
#define PSI_usmallint   PSI_ulong
 
#define PSI_mediumint   PSI_long
 
#define PSI_umediumint   PSI_ulong
 
#define PSI_int   PSI_long
 
#define PSI_uint   PSI_ulong
 
#define PSI_bigint   PSI_longlong
 
#define PSI_ubigint   PSI_ulonglong
 
#define PSI_year   PSI_ulong
 
#define PSI_enum   PSI_ulonglong
 
#define PSI_decimal   PSI_double
 
#define PSI_float   PSI_double
 

Typedefs

typedef struct PFS_string PFS_string
 
typedef struct PSI_field PSI_field
 This is an opaque structure to denote filed in plugin/component code. More...
 
typedef struct PSI_table_handle PSI_table_handle
 This is an opaque structure to denote table handle in plugin/component code. More...
 
typedef struct PSI_pos PSI_pos
 This is an opaque structure to denote cursor position in plugin/component code. More...
 
typedef struct PSI_key_reader PSI_key_reader
 This is an opaque structure to denote Key Reader in plugin/component code. More...
 
typedef struct PSI_index_handle PSI_index_handle
 This is an opaque structure to denote Index Handle in plugin/component code. More...
 
typedef struct PSI_long PSI_long
 
typedef struct PSI_ulong PSI_ulong
 
typedef struct PSI_longlong PSI_longlong
 
typedef struct PSI_ulonglong PSI_ulonglong
 
typedef struct PSI_double PSI_double
 
typedef struct PSI_plugin_key_integer PSI_plugin_key_integer
 
typedef PSI_plugin_key_integer PSI_plugin_key_tinyint
 
typedef PSI_plugin_key_integer PSI_plugin_key_smallint
 
typedef PSI_plugin_key_integer PSI_plugin_key_mediumint
 
typedef struct PSI_plugin_key_uinteger PSI_plugin_key_uinteger
 
typedef PSI_plugin_key_uinteger PSI_plugin_key_utinyint
 
typedef PSI_plugin_key_uinteger PSI_plugin_key_usmallint
 
typedef PSI_plugin_key_uinteger PSI_plugin_key_umediumint
 
typedef struct PSI_plugin_key_bigint PSI_plugin_key_bigint
 
typedef struct PSI_plugin_key_ubigint PSI_plugin_key_ubigint
 
typedef struct PSI_plugin_key_string PSI_plugin_key_string
 
typedef int(* rnd_next_t) (PSI_table_handle *handle)
 Api to read the next record. More...
 
typedef int(* rnd_init_t) (PSI_table_handle *handle, bool scan)
 API to initialize for random scan or read. More...
 
typedef int(* rnd_pos_t) (PSI_table_handle *handle)
 API to read row from a position which is set in table handle. More...
 
typedef int(* index_init_t) (PSI_table_handle *handle, unsigned int idx, bool sorted, PSI_index_handle **index)
 API to initialize index(es). More...
 
typedef int(* index_read_t) (PSI_index_handle *index, PSI_key_reader *reader, unsigned int idx, int find_flag)
 API to read keys in index. More...
 
typedef int(* index_next_t) (PSI_table_handle *handle)
 API to read next record with matching index. More...
 
typedef void(* reset_position_t) (PSI_table_handle *handle)
 API to reset cursor position. More...
 
typedef int(* read_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)
 API to read a column value from table. More...
 
typedef int(* write_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)
 API to write a column value in table. More...
 
typedef int(* write_row_values_t) (PSI_table_handle *handle)
 API to write a record in table. More...
 
typedef int(* update_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)
 API to update a column value in table. More...
 
typedef int(* update_row_values_t) (PSI_table_handle *handle)
 API to write a record in table. More...
 
typedef int(* delete_row_values_t) (PSI_table_handle *handle)
 API to delete record from table. More...
 
typedef PSI_table_handle *(* open_table_t) (PSI_pos **pos)
 API to Open a table handle in plugin/component code and reset position pointer when a new table handle in opened in Performance Schema. More...
 
typedef void(* close_table_t) (PSI_table_handle *handle)
 API to Close a table handle in plugin/component code and reset position pointer when a table handle in closed in Performance Schema. More...
 
typedef struct PFS_engine_table_proxy PFS_engine_table_proxy
 
typedef int(* delete_all_rows_t) (void)
 API to delete/truncate all the rows in a table. More...
 
typedef unsigned long long(* get_row_count_t) (void)
 API to give number of rows in a table. More...
 
typedef struct PFS_engine_table_share_proxy PFS_engine_table_share_proxy
 
typedef struct s_mysql_pfs_plugin_table_v1 mysql_service_pfs_plugin_table_v1_t
 Definition of pfs_plugin_table_v1 service and its methods. More...
 
typedef struct s_mysql_pfs_plugin_column_tiny_v1 mysql_service_pfs_plugin_column_tiny_v1_t
 
typedef struct s_mysql_pfs_plugin_column_small_v1 mysql_service_pfs_plugin_column_small_v1_t
 
typedef struct s_mysql_pfs_plugin_column_medium_v1 mysql_service_pfs_plugin_column_medium_v1_t
 
typedef struct s_mysql_pfs_plugin_column_integer_v1 mysql_service_pfs_plugin_column_integer_v1_t
 
typedef struct s_mysql_pfs_plugin_column_bigint_v1 mysql_service_pfs_plugin_column_bigint_v1_t
 
typedef struct s_mysql_pfs_plugin_column_decimal_v1 mysql_service_pfs_plugin_column_decimal_v1_t
 
typedef struct s_mysql_pfs_plugin_column_float_v1 mysql_service_pfs_plugin_column_float_v1_t
 
typedef struct s_mysql_pfs_plugin_column_double_v1 mysql_service_pfs_plugin_column_double_v1_t
 
typedef struct s_mysql_pfs_plugin_column_string_v2 mysql_service_pfs_plugin_column_string_v2_t
 
typedef struct s_mysql_pfs_plugin_column_blob_v1 mysql_service_pfs_plugin_column_blob_v1_t
 
typedef struct s_mysql_pfs_plugin_column_enum_v1 mysql_service_pfs_plugin_column_enum_v1_t
 
typedef struct s_mysql_pfs_plugin_column_date_v1 mysql_service_pfs_plugin_column_date_v1_t
 
typedef struct s_mysql_pfs_plugin_column_time_v1 mysql_service_pfs_plugin_column_time_v1_t
 
typedef struct s_mysql_pfs_plugin_column_datetime_v1 mysql_service_pfs_plugin_column_datetime_v1_t
 
typedef struct s_mysql_pfs_plugin_column_timestamp_v1 mysql_service_pfs_plugin_column_timestamp_v1_t
 
typedef struct s_mysql_pfs_plugin_column_timestamp_v2 mysql_service_pfs_plugin_column_timestamp_v2_t
 
typedef struct s_mysql_pfs_plugin_column_year_v1 mysql_service_pfs_plugin_column_year_v1_t
 
typedef struct s_mysql_pfs_plugin_column_text_v1 mysql_service_pfs_plugin_column_text_v1_t
 

Enumerations

enum  Access_control { READONLY = 0 , TRUNCATABLE , UPDATABLE , EDITABLE }
 Types of access allowed to tables. More...
 

Macro Definition Documentation

◆ PFS_HA_ERR_END_OF_FILE

#define PFS_HA_ERR_END_OF_FILE   137

◆ PFS_HA_ERR_FOUND_DUPP_KEY

#define PFS_HA_ERR_FOUND_DUPP_KEY   121

◆ PFS_HA_ERR_NO_REFERENCED_ROW

#define PFS_HA_ERR_NO_REFERENCED_ROW   151

◆ PFS_HA_ERR_RECORD_DELETED

#define PFS_HA_ERR_RECORD_DELETED   134

◆ PFS_HA_ERR_RECORD_FILE_FULL

#define PFS_HA_ERR_RECORD_FILE_FULL   135

◆ PFS_HA_ERR_WRONG_COMMAND

#define PFS_HA_ERR_WRONG_COMMAND   131

◆ PSI_bigint

#define PSI_bigint   PSI_longlong

◆ PSI_decimal

#define PSI_decimal   PSI_double

◆ PSI_enum

#define PSI_enum   PSI_ulonglong

◆ PSI_float

#define PSI_float   PSI_double

◆ PSI_int

#define PSI_int   PSI_long

◆ PSI_mediumint

#define PSI_mediumint   PSI_long

◆ PSI_smallint

#define PSI_smallint   PSI_long

◆ PSI_tinyint

#define PSI_tinyint   PSI_long

◆ PSI_ubigint

#define PSI_ubigint   PSI_ulonglong

◆ PSI_uint

#define PSI_uint   PSI_ulong

◆ PSI_umediumint

#define PSI_umediumint   PSI_ulong

◆ PSI_usmallint

#define PSI_usmallint   PSI_ulong

◆ PSI_utinyint

#define PSI_utinyint   PSI_ulong

◆ PSI_year

#define PSI_year   PSI_ulong

Typedef Documentation

◆ close_table_t

typedef void(* close_table_t) (PSI_table_handle *handle)

API to Close a table handle in plugin/component code and reset position pointer when a table handle in closed in Performance Schema.

Parameters
handletable handle

◆ delete_all_rows_t

typedef int(* delete_all_rows_t) (void)

API to delete/truncate all the rows in a table.

◆ delete_row_values_t

typedef int(* delete_row_values_t) (PSI_table_handle *handle)

API to delete record from table.

Parameters
handleTable handle having record to be deleted.

◆ get_row_count_t

typedef unsigned long long(* get_row_count_t) (void)

API to give number of rows in a table.

Returns
number of rows.

◆ index_init_t

typedef int(* index_init_t) (PSI_table_handle *handle, unsigned int idx, bool sorted, PSI_index_handle **index)

API to initialize index(es).

Parameters
handleTable handle.
idxIndex of the index to be initialized (in case of multiple indexes on table)
sortedTrue if he index is sorted (typically a BTREE), false if not sorted (typically a HASH)
indexInitialized index handle.
Returns
Operation status
Return values
0Success
!=0Error

◆ index_next_t

typedef int(* index_next_t) (PSI_table_handle *handle)

API to read next record with matching index.

Parameters
handleTable handle.
Returns
Operation status
Return values
0Success
!=0Error

◆ index_read_t

typedef int(* index_read_t) (PSI_index_handle *index, PSI_key_reader *reader, unsigned int idx, int find_flag)

API to read keys in index.

Parameters
indexIndex handle.
readerKey reader.
idxIndex of the index to be read.
find_flagfind flag.
Returns
Operation status
Return values
0Success
!=0Error

◆ mysql_service_pfs_plugin_column_bigint_v1_t

◆ mysql_service_pfs_plugin_column_blob_v1_t

◆ mysql_service_pfs_plugin_column_date_v1_t

◆ mysql_service_pfs_plugin_column_datetime_v1_t

◆ mysql_service_pfs_plugin_column_decimal_v1_t

◆ mysql_service_pfs_plugin_column_double_v1_t

◆ mysql_service_pfs_plugin_column_enum_v1_t

◆ mysql_service_pfs_plugin_column_float_v1_t

◆ mysql_service_pfs_plugin_column_integer_v1_t

◆ mysql_service_pfs_plugin_column_medium_v1_t

◆ mysql_service_pfs_plugin_column_small_v1_t

◆ mysql_service_pfs_plugin_column_string_v2_t

◆ mysql_service_pfs_plugin_column_text_v1_t

◆ mysql_service_pfs_plugin_column_time_v1_t

◆ mysql_service_pfs_plugin_column_timestamp_v1_t

◆ mysql_service_pfs_plugin_column_timestamp_v2_t

◆ mysql_service_pfs_plugin_column_tiny_v1_t

◆ mysql_service_pfs_plugin_column_year_v1_t

◆ mysql_service_pfs_plugin_table_v1_t

Definition of pfs_plugin_table_v1 service and its methods.

◆ open_table_t

typedef PSI_table_handle *(* open_table_t) (PSI_pos **pos)

API to Open a table handle in plugin/component code and reset position pointer when a new table handle in opened in Performance Schema.

Note
The pos argument is a pointer to a pointer which references a buffer which identifies the current position (row) in the table. The value assigned to *pos by the open_table_t function is stored in table_plugin_table::m_pos and also the inherited PFS_engine_table::m_pos_ptr. In PFS_engine_table::get_position(void *ref) and PFS_engine_table::set_position(const void *ref), PFS_engine_table_share::m_ref_length bytes are copied (using memcpy) to/from this buffer to save/restore the current position in the table.

For this reason, any class/struct object used to hold the current table position and whose address gets assigned to *pos needs to be trivially copyable (std::trivially_copyable<T>::value must be true where T is the type of the object pointed to by *pos), and the PFS_engine_table_share_proxy::m_ref_length member variable (inherited from PFS_engine_table_share) must be set to the correct size for the class/struct used.

Parameters
pospos pointer to be updated.
Returns
initialized table handle.

◆ PFS_engine_table_proxy

◆ PFS_engine_table_share_proxy

◆ PFS_string

typedef struct PFS_string PFS_string

◆ PSI_double

typedef struct PSI_double PSI_double

◆ PSI_field

typedef struct PSI_field PSI_field

This is an opaque structure to denote filed in plugin/component code.

◆ PSI_index_handle

This is an opaque structure to denote Index Handle in plugin/component code.

◆ PSI_key_reader

This is an opaque structure to denote Key Reader in plugin/component code.

◆ PSI_long

typedef struct PSI_long PSI_long

◆ PSI_longlong

typedef struct PSI_longlong PSI_longlong

◆ PSI_plugin_key_bigint

◆ PSI_plugin_key_integer

◆ PSI_plugin_key_mediumint

◆ PSI_plugin_key_smallint

◆ PSI_plugin_key_string

◆ PSI_plugin_key_tinyint

◆ PSI_plugin_key_ubigint

◆ PSI_plugin_key_uinteger

◆ PSI_plugin_key_umediumint

◆ PSI_plugin_key_usmallint

◆ PSI_plugin_key_utinyint

◆ PSI_pos

typedef struct PSI_pos PSI_pos

This is an opaque structure to denote cursor position in plugin/component code.

◆ PSI_table_handle

This is an opaque structure to denote table handle in plugin/component code.

◆ PSI_ulong

typedef struct PSI_ulong PSI_ulong

◆ PSI_ulonglong

typedef struct PSI_ulonglong PSI_ulonglong

◆ read_column_value_t

typedef int(* read_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)

API to read a column value from table.

Parameters
handleTable handle.
fieldField for which value is to be read.
indexIndex of field in table column.
Returns
Operation status
Return values
0Success
!=0Error

◆ reset_position_t

typedef void(* reset_position_t) (PSI_table_handle *handle)

API to reset cursor position.

Parameters
handleTable handle.

◆ rnd_init_t

typedef int(* rnd_init_t) (PSI_table_handle *handle, bool scan)

API to initialize for random scan or read.

Parameters
handleTable handle.
scanTrue, if its a random scan. False, if its a random read.
Returns
Operation status
Return values
0Success
!=0Error

◆ rnd_next_t

typedef int(* rnd_next_t) (PSI_table_handle *handle)

Api to read the next record.

Parameters
handleTable handle.
Returns
Operation status
Return values
0Success
!=0Error

◆ rnd_pos_t

typedef int(* rnd_pos_t) (PSI_table_handle *handle)

API to read row from a position which is set in table handle.

Parameters
handleTable handle.
Returns
Operation status
Return values
0Success
!=0Error

◆ update_column_value_t

typedef int(* update_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)

API to update a column value in table.

Parameters
handleTable handle.
fieldField for which value is to be updated.
indexIndex of field in table column.
Returns
Operation status
Return values
0Success
!=0Error

◆ update_row_values_t

typedef int(* update_row_values_t) (PSI_table_handle *handle)

API to write a record in table.

Parameters
handleTable handle having updated record to be updated.

◆ write_column_value_t

typedef int(* write_column_value_t) (PSI_table_handle *handle, PSI_field *field, unsigned int index)

API to write a column value in table.

Parameters
handleTable handle.
fieldField for which value is to be written.
indexIndex of field in table column.
Returns
Operation status
Return values
0Success
!=0Error

◆ write_row_values_t

typedef int(* write_row_values_t) (PSI_table_handle *handle)

API to write a record in table.

Parameters
handleTable handle having new record to be written.

Enumeration Type Documentation

◆ Access_control

Types of access allowed to tables.

Enumerator
READONLY 
TRUNCATABLE 
UPDATABLE 
EDITABLE