MySQL 9.1.0
Source Code Documentation
handlerton Struct Reference

handlerton is a singleton structure - one instance per storage engine - to provide access to storage engine functionality that works on the "global" level (unlike handler class that works on a per-table basis). More...

#include <handler.h>

Public Attributes

SHOW_COMP_OPTION state
 Historical marker for if the engine is available or not. More...
 
enum legacy_db_type db_type
 Historical number used for frm file to determine the correct storage engine. More...
 
uint slot
 Each storage engine has it's own memory area (actually a pointer) in the thd, for storing per-connection information. More...
 
uint savepoint_offset
 To store per-savepoint data storage engine is provided with an area of a requested size (0 is ok here). More...
 
close_connection_t close_connection
 
kill_connection_t kill_connection
 
pre_dd_shutdown_t pre_dd_shutdown
 
reset_plugin_vars_t reset_plugin_vars
 
savepoint_set_t savepoint_set
 
savepoint_rollback_t savepoint_rollback
 
savepoint_rollback_can_release_mdl_t savepoint_rollback_can_release_mdl
 
savepoint_release_t savepoint_release
 
commit_t commit
 
rollback_t rollback
 
prepare_t prepare
 
recover_t recover
 
recover_prepared_in_tc_t recover_prepared_in_tc
 
commit_by_xid_t commit_by_xid
 
rollback_by_xid_t rollback_by_xid
 
set_prepared_in_tc_t set_prepared_in_tc
 
set_prepared_in_tc_by_xid_t set_prepared_in_tc_by_xid
 
create_t create
 
drop_database_t drop_database
 
log_ddl_drop_schema_t log_ddl_drop_schema
 
log_ddl_create_schema_t log_ddl_create_schema
 
panic_t panic
 
start_consistent_snapshot_t start_consistent_snapshot
 
flush_logs_t flush_logs
 
show_status_t show_status
 
partition_flags_t partition_flags
 
is_valid_tablespace_name_t is_valid_tablespace_name
 
get_tablespace_t get_tablespace
 
alter_tablespace_t alter_tablespace
 
get_tablespace_filename_ext_t get_tablespace_filename_ext
 
upgrade_tablespace_t upgrade_tablespace
 
upgrade_space_version_t upgrade_space_version
 
get_tablespace_type_t get_tablespace_type
 
get_tablespace_type_by_name_t get_tablespace_type_by_name
 
upgrade_logs_t upgrade_logs
 
finish_upgrade_t finish_upgrade
 
fill_is_table_t fill_is_table
 
dict_init_t dict_init
 
ddse_dict_init_t ddse_dict_init
 
dict_register_dd_table_id_t dict_register_dd_table_id
 
dict_cache_reset_t dict_cache_reset
 
dict_cache_reset_tables_and_tablespaces_t dict_cache_reset_tables_and_tablespaces
 
dict_recover_t dict_recover
 
dict_get_server_version_t dict_get_server_version
 
dict_set_server_version_t dict_set_server_version
 
is_reserved_db_name_t is_reserved_db_name
 
uint32 flags {0}
 Global handler flags. More...
 
binlog_func_t binlog_func
 
binlog_log_query_t binlog_log_query
 
acl_notify_t acl_notify
 
discover_t discover
 
find_files_t find_files
 
table_exists_in_engine_t table_exists_in_engine
 
push_to_engine_t push_to_engine
 
is_supported_system_table_t is_supported_system_table
 
sdi_create_t sdi_create
 
sdi_drop_t sdi_drop
 
sdi_get_keys_t sdi_get_keys
 
sdi_get_t sdi_get
 
sdi_set_t sdi_set
 
sdi_delete_t sdi_delete
 
const char ** file_extensions
 Null-ended array of file extensions that exist for the storage engine. More...
 
is_dict_readonly_t is_dict_readonly
 
rm_tmp_tables_t rm_tmp_tables
 
get_cost_constants_t get_cost_constants
 
replace_native_transaction_in_thd_t replace_native_transaction_in_thd
 
notify_exclusive_mdl_t notify_exclusive_mdl
 
notify_alter_table_t notify_alter_table
 
notify_rename_table_t notify_rename_table
 
notify_truncate_table_t notify_truncate_table
 
rotate_encryption_master_key_t rotate_encryption_master_key
 
redo_log_set_state_t redo_log_set_state
 
get_table_statistics_t get_table_statistics
 
get_index_column_cardinality_t get_index_column_cardinality
 
get_tablespace_statistics_t get_tablespace_statistics
 
post_ddl_t post_ddl
 
post_recover_t post_recover
 
Clone_interface_t clone_interface
 Clone data transfer interfaces. More...
 
uint32 license
 Flag for Engine License. More...
 
void * data
 Location for engines to keep personal structures. More...
 
lock_hton_log_t lock_hton_log
 
unlock_hton_log_t unlock_hton_log
 
collect_hton_log_info_t collect_hton_log_info
 
uint32 foreign_keys_flags
 Flags describing details of foreign key support by storage engine. More...
 
check_fk_column_compat_t check_fk_column_compat
 
LEX_CSTRING fk_name_suffix
 Suffix for auto-generated foreign key names for tables using this storage engine. More...
 
prepare_secondary_engine_t prepare_secondary_engine
 Pointer to a function that prepares a secondary engine for executing a statement. More...
 
optimize_secondary_engine_t optimize_secondary_engine
 Pointer to a function that optimizes the current statement for execution on the secondary storage engine represented by this handlerton. More...
 
compare_secondary_engine_cost_t compare_secondary_engine_cost
 Pointer to a function that estimates the cost of executing a join in a secondary storage engine. More...
 
SecondaryEngineFlags secondary_engine_flags
 Bitmap which contains the supported join types and other flags for a secondary storage engine when used with the hypergraph join optimizer. More...
 
external_engine_explain_check_t external_engine_explain_check
 Pointer to a function that checks if the table is loaded in the secondary engine in the case of an explain statement. More...
 
secondary_engine_modify_access_path_cost_t secondary_engine_modify_access_path_cost
 Pointer to a function that evaluates the cost of executing an access path in a secondary storage engine. More...
 
get_secondary_engine_offload_or_exec_fail_reason_t get_secondary_engine_offload_or_exec_fail_reason
 Pointer to a function that returns the query offload or exec failure reason as a string given a thread context (representing the query) when the offloaded query failed in a secondary storage engine. More...
 
find_secondary_engine_offload_fail_reason_t find_secondary_engine_offload_fail_reason
 Pointer to a function that finds and returns the query offload failure reason as a string given a thread context (representing the query) when get_secondary_engine_offload_or_exec_fail_reason returns an empty reason. More...
 
set_secondary_engine_offload_fail_reason_t set_secondary_engine_offload_fail_reason
 Pointer to a function that sets the offload failure reason as a string for a thread context (representing the query) when the offloaded query failed in a secondary storage engine. More...
 
secondary_engine_check_optimizer_request_t secondary_engine_check_optimizer_request
 Pointer to function that checks secondary engine request for updating hypergraph join optimization. More...
 
secondary_engine_pre_prepare_hook_t secondary_engine_pre_prepare_hook
 
se_before_commit_t se_before_commit
 
se_after_commit_t se_after_commit
 
se_before_rollback_t se_before_rollback
 
notify_after_select_t notify_after_select
 
notify_create_table_t notify_create_table
 
notify_drop_table_t notify_drop_table
 
Page_track_t page_track
 Page tracking interface. More...
 

Detailed Description

handlerton is a singleton structure - one instance per storage engine - to provide access to storage engine functionality that works on the "global" level (unlike handler class that works on a per-table basis).

usually handlerton instance is defined statically in ha_xxx.cc as

static handlerton { ... } xxx_hton;

savepoint_*, prepare, recover, and *_by_xid pointers can be 0.

Member Data Documentation

◆ acl_notify

acl_notify_t handlerton::acl_notify

◆ alter_tablespace

alter_tablespace_t handlerton::alter_tablespace

◆ binlog_func

binlog_func_t handlerton::binlog_func

◆ binlog_log_query

binlog_log_query_t handlerton::binlog_log_query

◆ check_fk_column_compat

check_fk_column_compat_t handlerton::check_fk_column_compat

◆ clone_interface

Clone_interface_t handlerton::clone_interface

Clone data transfer interfaces.

◆ close_connection

close_connection_t handlerton::close_connection

◆ collect_hton_log_info

collect_hton_log_info_t handlerton::collect_hton_log_info

◆ commit

commit_t handlerton::commit

◆ commit_by_xid

commit_by_xid_t handlerton::commit_by_xid

◆ compare_secondary_engine_cost

compare_secondary_engine_cost_t handlerton::compare_secondary_engine_cost

Pointer to a function that estimates the cost of executing a join in a secondary storage engine.

See also
compare_secondary_engine_cost_t for function signature.

◆ create

create_t handlerton::create

◆ data

void* handlerton::data

Location for engines to keep personal structures.

◆ db_type

enum legacy_db_type handlerton::db_type

Historical number used for frm file to determine the correct storage engine.

This is going away and new engines will just use "name" for this.

◆ ddse_dict_init

ddse_dict_init_t handlerton::ddse_dict_init

◆ dict_cache_reset

dict_cache_reset_t handlerton::dict_cache_reset

◆ dict_cache_reset_tables_and_tablespaces

dict_cache_reset_tables_and_tablespaces_t handlerton::dict_cache_reset_tables_and_tablespaces

◆ dict_get_server_version

dict_get_server_version_t handlerton::dict_get_server_version

◆ dict_init

dict_init_t handlerton::dict_init

◆ dict_recover

dict_recover_t handlerton::dict_recover

◆ dict_register_dd_table_id

dict_register_dd_table_id_t handlerton::dict_register_dd_table_id

◆ dict_set_server_version

dict_set_server_version_t handlerton::dict_set_server_version

◆ discover

discover_t handlerton::discover

◆ drop_database

drop_database_t handlerton::drop_database

◆ external_engine_explain_check

external_engine_explain_check_t handlerton::external_engine_explain_check

Pointer to a function that checks if the table is loaded in the secondary engine in the case of an explain statement.

See also
external_engine_explain_check_t for function signature.

◆ file_extensions

const char** handlerton::file_extensions

Null-ended array of file extensions that exist for the storage engine.

Used by frm_error() and the default handler::rename_table and delete_table methods in handler.cc.

For engines that have two file name extensions (separate meta/index file and data file), the order of elements is relevant. First element of engine file name extensions array should be meta/index file extension. Second element - data file extension. This order is assumed by prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.

For engines that don't have files, file_extensions is NULL.

Currently, the following alternatives are used:

  • file_extensions == NULL;
  • file_extensions[0] != NULL, file_extensions[1] == NULL;
  • file_extensions[0] != NULL, file_extensions[1] != NULL, file_extensions[2] == NULL;

◆ fill_is_table

fill_is_table_t handlerton::fill_is_table

◆ find_files

find_files_t handlerton::find_files

◆ find_secondary_engine_offload_fail_reason

find_secondary_engine_offload_fail_reason_t handlerton::find_secondary_engine_offload_fail_reason

Pointer to a function that finds and returns the query offload failure reason as a string given a thread context (representing the query) when get_secondary_engine_offload_or_exec_fail_reason returns an empty reason.

See also
find_secondary_engine_offload_fail_reason_t for function signature.

◆ finish_upgrade

finish_upgrade_t handlerton::finish_upgrade

◆ fk_name_suffix

LEX_CSTRING handlerton::fk_name_suffix

Suffix for auto-generated foreign key names for tables using this storage engine.

If such suffix is specified by SE then its generated foreign key names follow (table name)(SE-specific FK name suffix)(FK number) pattern. Length of such suffix should not exceed MAX_FK_NAME_SUFFIX_LENGTH bytes. If no suffix is specified then FK_NAME_DEFAULT_SUFFIX is used as default.

◆ flags

uint32 handlerton::flags {0}

Global handler flags.

◆ flush_logs

flush_logs_t handlerton::flush_logs

◆ foreign_keys_flags

uint32 handlerton::foreign_keys_flags

Flags describing details of foreign key support by storage engine.

◆ get_cost_constants

get_cost_constants_t handlerton::get_cost_constants

◆ get_index_column_cardinality

get_index_column_cardinality_t handlerton::get_index_column_cardinality

◆ get_secondary_engine_offload_or_exec_fail_reason

get_secondary_engine_offload_or_exec_fail_reason_t handlerton::get_secondary_engine_offload_or_exec_fail_reason

Pointer to a function that returns the query offload or exec failure reason as a string given a thread context (representing the query) when the offloaded query failed in a secondary storage engine.

See also
get_secondary_engine_offload_or_exec_fail_reason_t for function signature.

◆ get_table_statistics

get_table_statistics_t handlerton::get_table_statistics

◆ get_tablespace

get_tablespace_t handlerton::get_tablespace

◆ get_tablespace_filename_ext

get_tablespace_filename_ext_t handlerton::get_tablespace_filename_ext

◆ get_tablespace_statistics

get_tablespace_statistics_t handlerton::get_tablespace_statistics

◆ get_tablespace_type

get_tablespace_type_t handlerton::get_tablespace_type

◆ get_tablespace_type_by_name

get_tablespace_type_by_name_t handlerton::get_tablespace_type_by_name

◆ is_dict_readonly

is_dict_readonly_t handlerton::is_dict_readonly

◆ is_reserved_db_name

is_reserved_db_name_t handlerton::is_reserved_db_name

◆ is_supported_system_table

is_supported_system_table_t handlerton::is_supported_system_table

◆ is_valid_tablespace_name

is_valid_tablespace_name_t handlerton::is_valid_tablespace_name

◆ kill_connection

kill_connection_t handlerton::kill_connection

◆ license

uint32 handlerton::license

Flag for Engine License.

◆ lock_hton_log

lock_hton_log_t handlerton::lock_hton_log

◆ log_ddl_create_schema

log_ddl_create_schema_t handlerton::log_ddl_create_schema

◆ log_ddl_drop_schema

log_ddl_drop_schema_t handlerton::log_ddl_drop_schema

◆ notify_after_select

notify_after_select_t handlerton::notify_after_select

◆ notify_alter_table

notify_alter_table_t handlerton::notify_alter_table

◆ notify_create_table

notify_create_table_t handlerton::notify_create_table

◆ notify_drop_table

notify_drop_table_t handlerton::notify_drop_table

◆ notify_exclusive_mdl

notify_exclusive_mdl_t handlerton::notify_exclusive_mdl

◆ notify_rename_table

notify_rename_table_t handlerton::notify_rename_table

◆ notify_truncate_table

notify_truncate_table_t handlerton::notify_truncate_table

◆ optimize_secondary_engine

optimize_secondary_engine_t handlerton::optimize_secondary_engine

Pointer to a function that optimizes the current statement for execution on the secondary storage engine represented by this handlerton.

See also
optimize_secondary_engine_t for function signature.

◆ page_track

Page_track_t handlerton::page_track

Page tracking interface.

◆ panic

panic_t handlerton::panic

◆ partition_flags

partition_flags_t handlerton::partition_flags

◆ post_ddl

post_ddl_t handlerton::post_ddl

◆ post_recover

post_recover_t handlerton::post_recover

◆ pre_dd_shutdown

pre_dd_shutdown_t handlerton::pre_dd_shutdown

◆ prepare

prepare_t handlerton::prepare

◆ prepare_secondary_engine

prepare_secondary_engine_t handlerton::prepare_secondary_engine

Pointer to a function that prepares a secondary engine for executing a statement.

See also
prepare_secondary_engine_t for function signature.

◆ push_to_engine

push_to_engine_t handlerton::push_to_engine

◆ recover

recover_t handlerton::recover

◆ recover_prepared_in_tc

recover_prepared_in_tc_t handlerton::recover_prepared_in_tc

◆ redo_log_set_state

redo_log_set_state_t handlerton::redo_log_set_state

◆ replace_native_transaction_in_thd

replace_native_transaction_in_thd_t handlerton::replace_native_transaction_in_thd

◆ reset_plugin_vars

reset_plugin_vars_t handlerton::reset_plugin_vars

◆ rm_tmp_tables

rm_tmp_tables_t handlerton::rm_tmp_tables

◆ rollback

rollback_t handlerton::rollback

◆ rollback_by_xid

rollback_by_xid_t handlerton::rollback_by_xid

◆ rotate_encryption_master_key

rotate_encryption_master_key_t handlerton::rotate_encryption_master_key

◆ savepoint_offset

uint handlerton::savepoint_offset

To store per-savepoint data storage engine is provided with an area of a requested size (0 is ok here).

savepoint_offset must be initialized statically to the size of the needed memory to store per-savepoint information. After xxx_init it is changed to be an offset to savepoint storage area and need not be used by storage engine. see binlog_hton and binlog_savepoint_set/rollback for an example.

◆ savepoint_release

savepoint_release_t handlerton::savepoint_release

◆ savepoint_rollback

savepoint_rollback_t handlerton::savepoint_rollback

◆ savepoint_rollback_can_release_mdl

savepoint_rollback_can_release_mdl_t handlerton::savepoint_rollback_can_release_mdl

◆ savepoint_set

savepoint_set_t handlerton::savepoint_set

◆ sdi_create

sdi_create_t handlerton::sdi_create

◆ sdi_delete

sdi_delete_t handlerton::sdi_delete

◆ sdi_drop

sdi_drop_t handlerton::sdi_drop

◆ sdi_get

sdi_get_t handlerton::sdi_get

◆ sdi_get_keys

sdi_get_keys_t handlerton::sdi_get_keys

◆ sdi_set

sdi_set_t handlerton::sdi_set

◆ se_after_commit

se_after_commit_t handlerton::se_after_commit

◆ se_before_commit

se_before_commit_t handlerton::se_before_commit

◆ se_before_rollback

se_before_rollback_t handlerton::se_before_rollback

◆ secondary_engine_check_optimizer_request

secondary_engine_check_optimizer_request_t handlerton::secondary_engine_check_optimizer_request

Pointer to function that checks secondary engine request for updating hypergraph join optimization.

See also
secondary_engine_check_optimizer_request_t for function signature.

◆ secondary_engine_flags

SecondaryEngineFlags handlerton::secondary_engine_flags

Bitmap which contains the supported join types and other flags for a secondary storage engine when used with the hypergraph join optimizer.

If it is empty, it means that the secondary engine does not support the hypergraph join optimizer.

◆ secondary_engine_modify_access_path_cost

secondary_engine_modify_access_path_cost_t handlerton::secondary_engine_modify_access_path_cost

Pointer to a function that evaluates the cost of executing an access path in a secondary storage engine.

See also
secondary_engine_modify_access_path_cost_t for function signature.

◆ secondary_engine_pre_prepare_hook

secondary_engine_pre_prepare_hook_t handlerton::secondary_engine_pre_prepare_hook

◆ set_prepared_in_tc

set_prepared_in_tc_t handlerton::set_prepared_in_tc

◆ set_prepared_in_tc_by_xid

set_prepared_in_tc_by_xid_t handlerton::set_prepared_in_tc_by_xid

◆ set_secondary_engine_offload_fail_reason

set_secondary_engine_offload_fail_reason_t handlerton::set_secondary_engine_offload_fail_reason

Pointer to a function that sets the offload failure reason as a string for a thread context (representing the query) when the offloaded query failed in a secondary storage engine.

See also
set_secondary_engine_offload_fail_reason_t for function signature.

◆ show_status

show_status_t handlerton::show_status

◆ slot

uint handlerton::slot

Each storage engine has it's own memory area (actually a pointer) in the thd, for storing per-connection information.

It is accessed as

thd->ha_data[xxx_hton.slot]

slot number is initialized by MySQL after xxx_init() is called.

◆ start_consistent_snapshot

start_consistent_snapshot_t handlerton::start_consistent_snapshot

◆ state

SHOW_COMP_OPTION handlerton::state

Historical marker for if the engine is available or not.

◆ table_exists_in_engine

table_exists_in_engine_t handlerton::table_exists_in_engine

◆ unlock_hton_log

unlock_hton_log_t handlerton::unlock_hton_log

◆ upgrade_logs

upgrade_logs_t handlerton::upgrade_logs

◆ upgrade_space_version

upgrade_space_version_t handlerton::upgrade_space_version

◆ upgrade_tablespace

upgrade_tablespace_t handlerton::upgrade_tablespace

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