MySQL 9.1.0
Source Code Documentation
|
Classes | |
struct | TA_table_field_def |
Expected field definition. More... | |
struct | TA_index_field_def |
Expected index definition. More... | |
struct | s_mysql_table_access_factory_v1 |
Table access service, factory. More... | |
struct | s_mysql_table_access_v1 |
Table access service, table access. More... | |
struct | s_mysql_table_access_index_v1 |
Table access service, index scan. More... | |
struct | s_mysql_table_access_scan_v1 |
Table access service, table scan. More... | |
struct | s_mysql_table_access_update_v1 |
Table access service, update. More... | |
struct | s_mysql_table_access_binlog |
Table access service, control binlogging. More... | |
struct | s_mysql_field_access_nullability_v1 |
Table access service, all columns. More... | |
struct | s_mysql_field_integer_access_v1 |
Table access service, integer columns. More... | |
struct | s_mysql_field_varchar_access_v1 |
Table access service, varchar columns. More... | |
struct | s_mysql_field_any_access_v1 |
Table access service, any columns. More... | |
Macros | |
#define | TA_ERROR_GRL 1 |
#define | TA_ERROR_READONLY 2 |
#define | TA_ERROR_OPEN 3 |
Typedefs | |
typedef struct Table_access_imp * | Table_access |
Table_access. More... | |
typedef struct TA_table_imp * | TA_table |
An opened table. More... | |
typedef struct TA_key_imp * | TA_key |
An index key. More... | |
typedef Table_access(* | create_table_access_v1_t) (MYSQL_THD thd, size_t count) |
Create a table access object. More... | |
typedef void(* | destroy_table_access_v1_t) (Table_access ta) |
Destroy a table access object. More... | |
typedef size_t(* | add_table_v1_t) (Table_access ta, const char *schema_name, size_t schema_name_length, const char *table_name, size_t table_name_length, TA_lock_type lock_type_arg) |
Add a table to a table access session. More... | |
typedef int(* | begin_v1_t) (Table_access ta) |
Start a table access transaction. More... | |
typedef int(* | commit_v1_t) (Table_access ta) |
Commit changes. More... | |
typedef int(* | rollback_v1_t) (Table_access ta) |
Rollback changes. More... | |
typedef TA_table(* | get_table_v1_t) (Table_access ta, size_t ticket) |
Get an opened table. More... | |
typedef int(* | check_table_fields_v1_t) (Table_access ta, TA_table table, const TA_table_field_def *fields, size_t fields_count) |
Check the actual table fields against expected fields. More... | |
typedef int(* | index_init_v1_t) (Table_access ta, TA_table table, const char *index_name, size_t index_name_length, const TA_index_field_def *fields, size_t fields_count, TA_key *key) |
Open a table index. More... | |
typedef int(* | index_read_map_v1_t) (Table_access ta, TA_table table, size_t num_parts, TA_key key) |
Position a table index at a search key. More... | |
typedef int(* | index_first_v1_t) (Table_access ta, TA_table table, TA_key key) |
Position on index at the beginning. More... | |
typedef int(* | index_next_v1_t) (Table_access ta, TA_table table, TA_key key) |
Advance to the next record in the index. More... | |
typedef int(* | index_next_same_v1_t) (Table_access ta, TA_table table, TA_key key) |
Advance to the next record that matches the current search key. More... | |
typedef int(* | index_end_v1_t) (Table_access ta, TA_table table, TA_key key) |
Close an index. More... | |
typedef int(* | rnd_init_v1_t) (Table_access ta, TA_table table) |
Start a full table scan. More... | |
typedef int(* | rnd_next_v1_t) (Table_access ta, TA_table table) |
Advance to the next record in a table scan. More... | |
typedef int(* | rnd_end_v1_t) (Table_access ta, TA_table table) |
End a full table scan. More... | |
typedef int(* | write_row_v1_t) (Table_access ta, TA_table table) |
Insert a new row in the table. More... | |
typedef int(* | update_row_v1_t) (Table_access ta, TA_table table) |
Update the current row. More... | |
typedef int(* | delete_row_v1_t) (Table_access ta, TA_table table) |
Delete the current row. More... | |
typedef void(* | set_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Set a column to NULL. More... | |
typedef bool(* | is_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Is a column NULL. More... | |
typedef bool(* | maybe_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Can a column be NULL. More... | |
typedef int(* | set_field_integer_value_v1_t) (Table_access ta, TA_table table, size_t index, long long v) |
Write an INTEGER column value. More... | |
typedef int(* | get_field_integer_value_v1_t) (Table_access ta, TA_table table, size_t index, long long *v) |
Read an INTEGER column value. More... | |
typedef int(* | set_field_varchar_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Write a VARCHAR column value. More... | |
typedef int(* | get_field_varchar_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Read a VARCHAR column value. More... | |
typedef int(* | set_field_any_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Write any column value. More... | |
typedef int(* | get_field_any_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Read any column value. More... | |
typedef void(* | table_access_binlog_set_t) (Table_access ta, bool is_binlogging) |
Turns on or off the binlogging flag for the current thread. More... | |
typedef bool(* | table_access_binlog_get_t) (Table_access ta) |
Gets the binlogging flag for the current thread. More... | |
typedef struct s_mysql_table_access_factory_v1 | mysql_service_table_access_factory_v1_t |
Table access service, factory. More... | |
typedef struct s_mysql_table_access_v1 | mysql_service_table_access_v1_t |
Table access service, table access. More... | |
typedef struct s_mysql_table_access_index_v1 | mysql_service_table_access_index_v1_t |
Table access service, index scan. More... | |
typedef struct s_mysql_table_access_scan_v1 | mysql_service_table_access_scan_v1_t |
Table access service, table scan. More... | |
typedef struct s_mysql_table_access_update_v1 | mysql_service_table_access_update_v1_t |
Table access service, update. More... | |
typedef struct s_mysql_table_access_binlog | mysql_service_table_access_binlog_t |
Table access service, control binlogging. More... | |
typedef struct s_mysql_field_access_nullability_v1 | mysql_service_field_access_nullability_v1_t |
Table access service, all columns. More... | |
typedef struct s_mysql_field_integer_access_v1 | mysql_service_field_integer_access_v1_t |
Table access service, integer columns. More... | |
typedef struct s_mysql_field_varchar_access_v1 | mysql_service_field_varchar_access_v1_t |
Table access service, varchar columns. More... | |
typedef struct s_mysql_field_any_access_v1 | mysql_service_field_any_access_v1_t |
Table access service, any columns. More... | |
Enumerations | |
enum | TA_lock_type { TA_READ , TA_WRITE } |
Table lock type. More... | |
enum | TA_field_type { TA_TYPE_UNKNOWN = 0 , TA_TYPE_INTEGER = 1 , TA_TYPE_VARCHAR = 2 , TA_TYPE_JSON = 3 , TA_TYPE_ENUM = 4 } |
Types of columns supported by the table access service. More... | |
#define TA_ERROR_GRL 1 |
#define TA_ERROR_OPEN 3 |
#define TA_ERROR_READONLY 2 |
typedef size_t(* add_table_v1_t) (Table_access ta, const char *schema_name, size_t schema_name_length, const char *table_name, size_t table_name_length, TA_lock_type lock_type_arg) |
Add a table to a table access session.
This method adds a table to a table access session. It returns a ticket, to use with get_table_v1_t.
ta | Table access session |
schema_name | Schema name raw buffer, in UTF8MB4. |
schema_name_length | Length, in bytes, of schema_name |
table_name | Table name raw buffer, in UTF8MB4. |
table_name_length | Length, in bytes, of table_name |
lock_type_arg | Lock type to use (read or write) |
typedef int(* begin_v1_t) (Table_access ta) |
Start a table access transaction.
Open all tables from the table access session, and lock them.
Locking all the tables at once is necessary to prevent deadlocks on table metadata between different sessions. The caller should not own the global read lock when opening tables, as this would also create deadlocks.
0 | success |
TA_ERROR_GRL | Global read lock held by the caller |
TA_ERROR_OPEN | Failed to open and lock tables. |
typedef int(* check_table_fields_v1_t) (Table_access ta, TA_table table, const TA_table_field_def *fields, size_t fields_count) |
Check the actual table fields against expected fields.
0 | success |
typedef int(* commit_v1_t) (Table_access ta) |
Commit changes.
typedef Table_access(* create_table_access_v1_t) (MYSQL_THD thd, size_t count) |
Create a table access object.
thd | The current session. Pass a null ptr if running from a non-MySQLd thread |
count | The maximum number of tables to access. |
log_bin
transaction_isolation
skip_readonly_check
typedef int(* delete_row_v1_t) (Table_access ta, TA_table table) |
Delete the current row.
typedef void(* destroy_table_access_v1_t) (Table_access ta) |
Destroy a table access object.
typedef int(* get_field_any_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Read any column value.
This is a generic interface. The column value is converted to a string, expressed in UTF8MB4_bin.
typedef int(* get_field_integer_value_v1_t) (Table_access ta, TA_table table, size_t index, long long *v) |
Read an INTEGER column value.
typedef int(* get_field_varchar_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Read a VARCHAR column value.
typedef TA_table(* get_table_v1_t) (Table_access ta, size_t ticket) |
Get an opened table.
Once tables are opened and locked, this method returns the opened table that correspond to the ticket returned by add tables.
typedef int(* index_end_v1_t) (Table_access ta, TA_table table, TA_key key) |
Close an index.
typedef int(* index_first_v1_t) (Table_access ta, TA_table table, TA_key key) |
Position on index at the beginning.
typedef int(* index_init_v1_t) (Table_access ta, TA_table table, const char *index_name, size_t index_name_length, const TA_index_field_def *fields, size_t fields_count, TA_key *key) |
Open a table index.
An index is identified by name. The caller lists the columns expected in the index. If the index DDL matches the expected columns and count, the index is opened. Otherwise, an error is returned, and the index is not opened.
ta | Table access | |
table | Opened table | |
index_name | Index name, in UTF8MB4, must match the table DDL. | |
index_name_length | Length of index_name, in bytes. | |
fields | Expected fields for the index | |
fields_count | Expected number of fields for the index | |
[out] | key | Opened index. |
0 | Success |
typedef int(* index_next_same_v1_t) (Table_access ta, TA_table table, TA_key key) |
Advance to the next record that matches the current search key.
typedef int(* index_next_v1_t) (Table_access ta, TA_table table, TA_key key) |
Advance to the next record in the index.
typedef int(* index_read_map_v1_t) (Table_access ta, TA_table table, size_t num_parts, TA_key key) |
Position a table index at a search key.
The search key is not passed explicitly in this call. The search key is set by populating columns in the table current record, before invoking this method.
ta | Table access |
table | Opened table |
num_parts | Number of key parts populated in the current record. |
key | Opened index |
typedef bool(* is_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Is a column NULL.
typedef bool(* maybe_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Can a column be NULL.
Table access service, all columns.
Version 1. Status: active
typedef struct s_mysql_field_any_access_v1 mysql_service_field_any_access_v1_t |
Table access service, any columns.
Version 1. Status: active
Table access service, integer columns.
Version 1. Status: active
Table access service, varchar columns.
Version 1. Status: active
typedef struct s_mysql_table_access_binlog mysql_service_table_access_binlog_t |
Table access service, control binlogging.
Table access service, factory.
Version 1. Status: active
Table access service, index scan.
Version 1. Status: active
typedef struct s_mysql_table_access_scan_v1 mysql_service_table_access_scan_v1_t |
Table access service, table scan.
Version 1. Status: active
Table access service, update.
Version 1. Status: active
typedef struct s_mysql_table_access_v1 mysql_service_table_access_v1_t |
Table access service, table access.
Version 1. Status: active
typedef int(* rnd_end_v1_t) (Table_access ta, TA_table table) |
End a full table scan.
typedef int(* rnd_init_v1_t) (Table_access ta, TA_table table) |
Start a full table scan.
typedef int(* rnd_next_v1_t) (Table_access ta, TA_table table) |
Advance to the next record in a table scan.
typedef int(* rollback_v1_t) (Table_access ta) |
Rollback changes.
typedef int(* set_field_any_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Write any column value.
This is a generic interface. The column value must be expressed in UTF8MB4_bin, and is converted to the column type.
typedef int(* set_field_integer_value_v1_t) (Table_access ta, TA_table table, size_t index, long long v) |
Write an INTEGER column value.
typedef void(* set_field_null_v1_t) (Table_access ta, TA_table table, size_t index) |
Set a column to NULL.
typedef int(* set_field_varchar_value_v1_t) (Table_access ta, TA_table table, size_t index, my_h_string v) |
Write a VARCHAR column value.
typedef struct TA_key_imp* TA_key |
An index key.
typedef struct TA_table_imp* TA_table |
An opened table.
typedef struct Table_access_imp* Table_access |
Table_access.
A table access session.
typedef bool(* table_access_binlog_get_t) (Table_access ta) |
Gets the binlogging flag for the current thread.
typedef void(* table_access_binlog_set_t) (Table_access ta, bool is_binlogging) |
Turns on or off the binlogging flag for the current thread.
typedef int(* update_row_v1_t) (Table_access ta, TA_table table) |
Update the current row.
typedef int(* write_row_v1_t) (Table_access ta, TA_table table) |
Insert a new row in the table.
enum TA_field_type |
enum TA_lock_type |