MySQL 8.0.39
Source Code Documentation
anonymous_namespace{sql_table.cc} Namespace Reference

Classes

struct  Handlerton_pair
 
class  Replace_field_processor_arg
 This class is used as an input argument to Item::walk, and takes care of replacing the field pointer in Item_field with pointers to a Create_field_wrapper. More...
 
struct  sort_keys
 
struct  Viability
 

Typedefs

using Viability_error_emitter = std::function< void(const char *engine_name)>
 
using Viability_substitution_warning_emitter = std::function< void(THD *, const char *requested_engine_name, const char *substituted_engine_name, const char *table_name)>
 

Functions

bool is_temp_table (const HA_CREATE_INFO &ci)
 
bool is_engine_specified (const HA_CREATE_INFO &ci)
 
handlertondefault_handlerton (THD *thd, const HA_CREATE_INFO &ci)
 
handlertonrequested_handlerton (THD *thd, const HA_CREATE_INFO &ci)
 
Viability get_viability (const handlerton &hton, const HA_CREATE_INFO &ci)
 
handlertonget_viable_handlerton_for_create_impl (THD *thd, const char *table_name, const HA_CREATE_INFO &ci, Handlerton_pair hp)
 
handlertonget_viable_handlerton_for_create_like (THD *thd, const char *table_name, const HA_CREATE_INFO &ci, handlerton *source)
 Check if source is enabled AND NOT explicitly disabled (listed in the disabled_storages_engines system variable. More...
 
handlertonget_viable_handlerton_for_alter (THD *thd, const HA_CREATE_INFO &ci, handlerton *existing)
 Does nothing (returns existing) unless ALTER changes the ENGINE. More...
 

Typedef Documentation

◆ Viability_error_emitter

using anonymous_namespace{sql_table.cc}::Viability_error_emitter = typedef std::function<void(const char *engine_name)>

◆ Viability_substitution_warning_emitter

using anonymous_namespace{sql_table.cc}::Viability_substitution_warning_emitter = typedef std::function<void( THD *, const char *requested_engine_name, const char *substituted_engine_name, const char *table_name)>

Function Documentation

◆ default_handlerton()

handlerton * anonymous_namespace{sql_table.cc}::default_handlerton ( THD thd,
const HA_CREATE_INFO ci 
)

◆ get_viability()

Viability anonymous_namespace{sql_table.cc}::get_viability ( const handlerton hton,
const HA_CREATE_INFO ci 
)

◆ get_viable_handlerton_for_alter()

handlerton * anonymous_namespace{sql_table.cc}::get_viable_handlerton_for_alter ( THD thd,
const HA_CREATE_INFO ci,
handlerton existing 
)

Does nothing (returns existing) unless ALTER changes the ENGINE.

The handlerton for the specified ENGINE is considered viable if it is enabled AND NOT explicitly disabled (listed in the disabled_storages_engines system variable).

If the specified handleton is not viable it falls back to existing if substitution is allowed. existing is used without further checking, and ER_UNKNOWN_STORAGE_ENGINE is emitted as warning.

Parameters
thdThread handler.
cicreate info struct from parser.
existingHandlerton requested by query.
Return values
existingif ENGINE is not specified or is the same as existing, or if ENGINE is not viable and substitution is permitted.
Handlertonof specified engine if this is viable.
nullptrif error (specified engine not viable and substitution not permitted).

◆ get_viable_handlerton_for_create_impl()

handlerton * anonymous_namespace{sql_table.cc}::get_viable_handlerton_for_create_impl ( THD thd,
const char *  table_name,
const HA_CREATE_INFO ci,
Handlerton_pair  hp 
)

◆ get_viable_handlerton_for_create_like()

handlerton * anonymous_namespace{sql_table.cc}::get_viable_handlerton_for_create_like ( THD thd,
const char *  table_name,
const HA_CREATE_INFO ci,
handlerton source 
)

Check if source is enabled AND NOT explicitly disabled (listed in the disabled_storages_engines system variable.

If not; falls back to the default (tmp) storage engine if substitution is allowed, unless this is also disabled.

Otherwise, if substitution does take place, ER_DISABLED_STORAGE_ENGINE and ER_USING_OTHER_HANDLER are emitted as warnings.

For temporary tables the above also applies, and in addition the source handlerton is checked to see if it supports temporary tables.

Note that this substitution is allowed even when no_substitution is ON, but will fail if the default handlerton for temporary tables is disabled or does not support temporary tables (unlikely).

Parameters
thdThread handler.
table_nameTable name.
cicreate info struct from parser.
sourceHandlerton requested by query.
Return values
sourceif this is viable.
Thedefault hton if viable and engine substitution is allowed.
Thedefault temp hton if viable and a temporary table and source does not support temporary tables.
nullptrif error (source not viable and substitution not possible).

◆ is_engine_specified()

bool anonymous_namespace{sql_table.cc}::is_engine_specified ( const HA_CREATE_INFO ci)

◆ is_temp_table()

bool anonymous_namespace{sql_table.cc}::is_temp_table ( const HA_CREATE_INFO ci)

◆ requested_handlerton()

handlerton * anonymous_namespace{sql_table.cc}::requested_handlerton ( THD thd,
const HA_CREATE_INFO ci 
)