Struct mariadb_sys::handlerton
source · #[repr(C)]pub struct handlerton {Show 61 fields
pub db_type: Type,
pub slot: uint,
pub savepoint_offset: uint,
pub close_connection: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> c_int>,
pub kill_query: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, level: Type)>,
pub savepoint_set: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>,
pub savepoint_rollback: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>,
pub savepoint_rollback_can_release_mdl: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> bool>,
pub savepoint_release: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>,
pub commit: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>,
pub commit_ordered: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool)>,
pub rollback: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>,
pub prepare: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>,
pub prepare_ordered: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool)>,
pub recover: Option<unsafe extern "C" fn(hton: *mut handlerton, xid_list: *mut XID, len: uint) -> c_int>,
pub commit_by_xid: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>,
pub rollback_by_xid: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>,
pub commit_checkpoint_request: Option<unsafe extern "C" fn(cookie: *mut c_void)>,
pub checkpoint_state: Option<unsafe extern "C" fn(hton: *mut handlerton, disabled: bool) -> c_int>,
pub create_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> *mut c_void>,
pub set_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, read_view: *mut c_void)>,
pub close_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, read_view: *mut c_void)>,
pub create: Option<unsafe extern "C" fn(hton: *mut handlerton, table: *mut TABLE_SHARE, mem_root: *mut MEM_ROOT) -> *mut handler>,
pub drop_database: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *mut c_char)>,
pub drop_table: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *const c_char) -> c_int>,
pub panic: Option<unsafe extern "C" fn(hton: *mut handlerton, flag: Type) -> c_int>,
pub start_consistent_snapshot: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> c_int>,
pub flush_logs: Option<unsafe extern "C" fn(hton: *mut handlerton) -> bool>,
pub show_status: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, print: stat_print_fn, stat: Type) -> bool>,
pub partition_flags: Option<unsafe extern "C" fn() -> uint>,
pub alter_table_flags: Option<unsafe extern "C" fn(flags: alter_table_operations) -> alter_table_operations>,
pub fill_is_table: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, tables: *mut TABLE_LIST, cond: *mut Item, arg1: Type) -> c_int>,
pub flags: uint32,
pub binlog_func: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, fn_: Type, arg: *mut c_void) -> c_int>,
pub binlog_log_query: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, binlog_command: Type, query: *const c_char, query_length: uint, db: *const c_char, table_name: *const c_char)>,
pub abort_transaction: Option<unsafe extern "C" fn(hton: *mut handlerton, bf_thd: *mut THD, victim_thd: *mut THD, signal: my_bool)>,
pub set_checkpoint: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *const XID) -> c_int>,
pub get_checkpoint: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>,
pub check_version: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *const c_char, version: *const LEX_CUSTRING, create_id: ulonglong) -> c_int>,
pub signal_ddl_recovery_done: Option<unsafe extern "C" fn(hton: *mut handlerton) -> c_int>,
pub update_optimizer_costs: Option<unsafe extern "C" fn(costs: *mut OPTIMIZER_COSTS)>,
pub optimizer_costs: *mut c_void,
pub table_options: *mut ha_create_table_option,
pub field_options: *mut ha_create_table_option,
pub index_options: *mut ha_create_table_option,
pub tablefile_extensions: *mut *const c_char,
pub create_group_by: Option<unsafe extern "C" fn(thd: *mut THD, query: *mut Query) -> *mut group_by_handler>,
pub create_derived: Option<unsafe extern "C" fn(thd: *mut THD, derived: *mut TABLE_LIST) -> *mut derived_handler>,
pub create_select: Option<unsafe extern "C" fn(thd: *mut THD, select_lex: *mut SELECT_LEX, select_lex_unit: *mut SELECT_LEX_UNIT) -> *mut select_handler>,
pub create_unit: Option<unsafe extern "C" fn(thd: *mut THD, select_unit: *mut SELECT_LEX_UNIT) -> *mut select_handler>,
pub discover_table: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, share: *mut TABLE_SHARE) -> c_int>,
pub discover_table_names: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *const LEX_CSTRING, dir: *mut MY_DIR, result: *mut handlerton_discovered_list) -> c_int>,
pub discover_table_existence: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *const c_char, table_name: *const c_char) -> c_int>,
pub discover_table_structure: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, share: *mut TABLE_SHARE, info: *mut HA_CREATE_INFO) -> c_int>,
pub notify_tabledef_changed: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *mut LEX_CSTRING, table_name: *mut LEX_CSTRING, frm: *mut LEX_CUSTRING, org_tabledef_version: *mut LEX_CUSTRING, file: *mut handler) -> c_int>,
pub prepare_commit_versioned: Option<unsafe extern "C" fn(thd: *mut THD, trx_id: *mut ulonglong) -> ulonglong>,
pub disable_internal_writes: Option<unsafe extern "C" fn(disable: bool)>,
pub prepare_for_backup: Option<unsafe extern "C" fn()>,
pub end_backup: Option<unsafe extern "C" fn()>,
pub pre_shutdown: Option<unsafe extern "C" fn()>,
pub create_partitioning_metadata: Option<unsafe extern "C" fn(path: *const c_char, old_path: *const c_char, action_flag: Type) -> c_int>,
}
Fields§
§db_type: Type
§slot: uint
§savepoint_offset: uint
§close_connection: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> c_int>
§kill_query: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, level: Type)>
§savepoint_set: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>
§savepoint_rollback: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>
§savepoint_rollback_can_release_mdl: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> bool>
Check if storage engine allows to release metadata locks which were acquired after the savepoint if rollback to savepoint is done. @return true - If it is safe to release MDL locks. false - If it is not.
savepoint_release: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, sv: *mut c_void) -> c_int>
§commit: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>
§commit_ordered: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool)>
§rollback: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>
§prepare: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool) -> c_int>
§prepare_ordered: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, all: bool)>
§recover: Option<unsafe extern "C" fn(hton: *mut handlerton, xid_list: *mut XID, len: uint) -> c_int>
§commit_by_xid: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>
§rollback_by_xid: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>
§commit_checkpoint_request: Option<unsafe extern "C" fn(cookie: *mut c_void)>
§checkpoint_state: Option<unsafe extern "C" fn(hton: *mut handlerton, disabled: bool) -> c_int>
§create_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> *mut c_void>
§set_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, read_view: *mut c_void)>
§close_cursor_read_view: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, read_view: *mut c_void)>
§create: Option<unsafe extern "C" fn(hton: *mut handlerton, table: *mut TABLE_SHARE, mem_root: *mut MEM_ROOT) -> *mut handler>
§drop_database: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *mut c_char)>
§drop_table: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *const c_char) -> c_int>
§panic: Option<unsafe extern "C" fn(hton: *mut handlerton, flag: Type) -> c_int>
§start_consistent_snapshot: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD) -> c_int>
§flush_logs: Option<unsafe extern "C" fn(hton: *mut handlerton) -> bool>
§show_status: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, print: stat_print_fn, stat: Type) -> bool>
§partition_flags: Option<unsafe extern "C" fn() -> uint>
§alter_table_flags: Option<unsafe extern "C" fn(flags: alter_table_operations) -> alter_table_operations>
§fill_is_table: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, tables: *mut TABLE_LIST, cond: *mut Item, arg1: Type) -> c_int>
§flags: uint32
§binlog_func: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, fn_: Type, arg: *mut c_void) -> c_int>
§binlog_log_query: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, binlog_command: Type, query: *const c_char, query_length: uint, db: *const c_char, table_name: *const c_char)>
§abort_transaction: Option<unsafe extern "C" fn(hton: *mut handlerton, bf_thd: *mut THD, victim_thd: *mut THD, signal: my_bool)>
§set_checkpoint: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *const XID) -> c_int>
§get_checkpoint: Option<unsafe extern "C" fn(hton: *mut handlerton, xid: *mut XID) -> c_int>
§check_version: Option<unsafe extern "C" fn(hton: *mut handlerton, path: *const c_char, version: *const LEX_CUSTRING, create_id: ulonglong) -> c_int>
Check if the version of the table matches the version in the .frm file.
This is mainly used to verify in recovery to check if an inplace ALTER TABLE succeded. Storage engines that does not support inplace alter table does not have to implement this function.
-
hton
() handlerton -
path
() Path for table -
version
() The unique id that is stored in the .frm file for CREATE and updated for each ALTER TABLE (but not for simple renames). This is the ID used for the final table. -
create_id
() The value returned from handler->table_version() for the original table (before ALTER TABLE).
Returns: 0 If id matches or table is newer than create_id (depending on what version check the engine supports. This means that The (inplace) alter table did succeed.
Returns: # > 0 Alter table did not succeed.
Related to handler::discover_check_version().
signal_ddl_recovery_done: Option<unsafe extern "C" fn(hton: *mut handlerton) -> c_int>
§update_optimizer_costs: Option<unsafe extern "C" fn(costs: *mut OPTIMIZER_COSTS)>
§optimizer_costs: *mut c_void
§table_options: *mut ha_create_table_option
§field_options: *mut ha_create_table_option
§index_options: *mut ha_create_table_option
§tablefile_extensions: *mut *const c_char
The list of extensions of files created for a single table in the database directory (datadir/db_name/).
Used by open_table_error(), by the default rename_table and delete_table handler methods, and by the default discovery implementation.
For engines that have more than one file name extensions (separate metadata, index, and/or data files), the order of elements is relevant. First element of engine file name extensions array should be metadata file extention. This is implied by the open_table_error() and the default discovery implementation.
Second element - data file extension. This is implied assumed by REPAIR TABLE … USE_FRM implementation.
create_group_by: Option<unsafe extern "C" fn(thd: *mut THD, query: *mut Query) -> *mut group_by_handler>
Functions to intercept queries
create_derived: Option<unsafe extern "C" fn(thd: *mut THD, derived: *mut TABLE_LIST) -> *mut derived_handler>
§create_select: Option<unsafe extern "C" fn(thd: *mut THD, select_lex: *mut SELECT_LEX, select_lex_unit: *mut SELECT_LEX_UNIT) -> *mut select_handler>
§create_unit: Option<unsafe extern "C" fn(thd: *mut THD, select_unit: *mut SELECT_LEX_UNIT) -> *mut select_handler>
§discover_table: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, share: *mut TABLE_SHARE) -> c_int>
Table discovery API. It allows the server to “discover” tables that exist in the storage engine, without user issuing an explicit CREATE TABLE statement.
discover_table_names: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *const LEX_CSTRING, dir: *mut MY_DIR, result: *mut handlerton_discovered_list) -> c_int>
§discover_table_existence: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *const c_char, table_name: *const c_char) -> c_int>
§discover_table_structure: Option<unsafe extern "C" fn(hton: *mut handlerton, thd: *mut THD, share: *mut TABLE_SHARE, info: *mut HA_CREATE_INFO) -> c_int>
§notify_tabledef_changed: Option<unsafe extern "C" fn(hton: *mut handlerton, db: *mut LEX_CSTRING, table_name: *mut LEX_CSTRING, frm: *mut LEX_CUSTRING, org_tabledef_version: *mut LEX_CUSTRING, file: *mut handler) -> c_int>
§prepare_commit_versioned: Option<unsafe extern "C" fn(thd: *mut THD, trx_id: *mut ulonglong) -> ulonglong>
Determine if system-versioned data was modified by the transaction.
thd
(in,out) current session @param[out] trx_id transaction start ID @return transaction commit ID
Returns: 0 if no system-versioned data was affected by the transaction
disable_internal_writes: Option<unsafe extern "C" fn(disable: bool)>
Disable or enable the internal writes of a storage engine
prepare_for_backup: Option<unsafe extern "C" fn()>
§end_backup: Option<unsafe extern "C" fn()>
§pre_shutdown: Option<unsafe extern "C" fn()>
§create_partitioning_metadata: Option<unsafe extern "C" fn(path: *const c_char, old_path: *const c_char, action_flag: Type) -> c_int>