MySQL 8.0.39
Source Code Documentation
|
The version of the current data dictionary table definitions. More...
Namespaces | |
namespace | anonymous_namespace{dd.cc} |
namespace | anonymous_namespace{sdi.cc} |
namespace | anonymous_namespace{tablespace_impl.cc} |
namespace | bootstrap |
namespace | cache |
namespace | info_schema |
namespace | ndbinfo |
namespace | performance_schema |
namespace | sdi |
namespace | sdi_file |
namespace | sdi_tablespace |
namespace | sdi_utils |
namespace | system_views |
namespace | tables |
namespace | upgrade |
namespace | upgrade_57 |
Classes | |
class | Abstract_table |
Abstract base class for tables and views. More... | |
class | Abstract_table_impl |
class | Charset |
class | Charset_impl |
class | Check_constraint |
class | Check_constraint_impl |
class | Check_constraint_name_error_handler |
Error handler to convert ER_DUP_ENTRY error to more user friendly error ER_CHECK_CONSTRAINT_DUP_NAME. More... | |
struct | Check_constraint_order_comparator |
Class used to sort check constraints by name for the same table. More... | |
class | Collation |
class | Collation_impl |
class | Collection |
class | Column |
class | Column_impl |
class | Column_statistics |
class | Column_statistics_impl |
class | Column_type_element |
class | Column_type_element_impl |
class | Composite_4char_key |
class | Composite_char_key |
class | Composite_obj_id_3char_key |
class | Composite_pk |
class | DD_kill_immunizer |
RAII class for immunizing the THD from kill operations. More... | |
class | Definer_reference_range_key |
class | Dictionary |
Main interface class enabling users to operate on data dictionary. More... | |
class | Dictionary_impl |
class | Entity_element |
Class to wrap an entity object. More... | |
class | Entity_object |
Base class for dictionary objects which has single column integer primary key. More... | |
class | Entity_object_impl |
class | Entity_object_table |
This class represents DD table like mysql.schemata, mysql.tables, mysql.tablespaces and more. More... | |
class | Entity_object_table_impl |
class | Entity_registry |
Class to represent collections of meta data for entities. More... | |
class | Event |
class | Event_impl |
class | Foreign_key |
class | Foreign_key_element |
class | Foreign_key_element_impl |
class | Foreign_key_impl |
class | Foreign_key_name_error_handler |
struct | Foreign_key_order_comparator |
Class used to sort Foreign key's by name for the same table. More... | |
class | Foreign_key_parent |
class | Function |
class | Function_impl |
class | Global_name_key |
class | Index |
class | Index_element |
class | Index_element_impl |
class | Index_impl |
class | Index_stat |
class | Index_stat_impl |
class | Index_stat_range_key |
class | Item_name_key |
class | Object_key |
class | Object_table |
This class represents all data dictionary table like mysql.tables, mysql.columns and more. More... | |
class | Object_table_definition |
The purpose of this interface is to enable retrieving the SQL statements necessary to create and populate a DD table. More... | |
class | Object_table_definition_impl |
class | Object_table_impl |
class | Open_dictionary_tables_ctx |
Auxiliary class for opening dictionary tables. More... | |
class | Parameter |
class | Parameter_impl |
class | Parameter_type_element |
class | Parameter_type_element_impl |
class | Parent_id_range_key |
class | Partition |
class | Partition_impl |
class | Partition_index |
class | Partition_index_impl |
struct | Partition_index_order_comparator |
Used to sort Partition_index objects for the same partition in the same order as Index objects for the table. More... | |
struct | Partition_order_comparator |
Used to compare two partition elements. More... | |
class | Partition_value |
class | Partition_value_impl |
struct | Partition_value_order_comparator |
Used to sort Partition_value objects for the same partition first according to list number and then according to the column number. More... | |
class | Primary_id_key |
class | Procedure |
class | Procedure_impl |
class | Properties |
The Properties class defines an interface for storing key=value pairs, where both key and value may be UTF-8 strings. More... | |
class | Properties_impl |
The Properties_impl class implements the Properties interface. More... | |
struct | Raw_key |
class | Raw_new_record |
class | Raw_record |
class | Raw_record_set |
class | Raw_table |
class | Resource_group |
class | Resource_group_impl |
struct | ResultType |
Template for structs to hold results from functions. More... | |
class | Routine |
Abstract base class for functions and procedures. More... | |
class | Routine_impl |
class | Routine_name_key |
class | Schema |
class | Schema_impl |
class | Schema_MDL_locker |
RAII based class to acquire and release schema meta data locks. More... | |
class | Sdi_rcontext |
Opaque context which keeps reusable resoureces needed during deserialization. More... | |
class | Sdi_wcontext |
Opaque context which keeps reusable resources needed during serialization. More... | |
class | Se_private_id_key |
class | Spatial_reference_system |
class | Spatial_reference_system_impl |
struct | String_type_alloc |
Functor class which allocates memory for String_type. More... | |
class | Sub_partition_range_key |
class | System_tables |
Class used to represent the dictionary tables. More... | |
class | System_tablespaces |
Class used to represent the system tablespaces. More... | |
class | System_views |
Class used to represent the system views. More... | |
class | Table |
class | Table_impl |
class | Table_reference_range_key |
class | Table_stat |
class | Table_stat_impl |
class | Tablespace |
class | Tablespace_file |
class | Tablespace_file_impl |
class | Tablespace_filename_error_handler |
class | Tablespace_impl |
struct | Tablespace_table_ref |
Represents tables with their id, name, schema id and schema name. More... | |
class | Transaction_ro |
Implementation of read-only data-dictionary transaction. More... | |
class | Trigger |
Class representing a Trigger in DD framework. More... | |
class | Trigger_impl |
struct | Trigger_order_comparator |
Used to sort Triggers of the same table by action timing, event type and action order. More... | |
class | Update_dictionary_tables_ctx |
Class for storing/restoring state during dictionary update operations. More... | |
class | View |
class | View_definer_reference_range_key |
class | View_impl |
class | View_routine |
class | View_routine_impl |
class | View_table |
class | View_table_impl |
class | Void_key |
class | Weak_object |
Base class for all data dictionary objects. More... | |
class | Weak_object_impl_ |
Typedefs | |
using | Encrypt_result = ResultType< bool > |
typedef String_type | Sdi_type |
using | SdiCompatibilityChecker = std::function< bool(const RJ_Document &)> |
Type alias for std::function wrapping a callable to check if SDI, as an RJ_Document, is compatible. More... | |
using | Weak_object_impl = Weak_object_impl_< true > |
typedef unsigned long long | Object_id |
typedef rapidjson::UTF8< char > | RJ_Encoding |
typedef rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > | RJ_Allocator |
typedef rapidjson::GenericDocument< RJ_Encoding, RJ_Allocator, rapidjson::CrtAllocator > | RJ_Document |
typedef rapidjson::GenericValue< RJ_Encoding, RJ_Allocator > | RJ_Value |
typedef rapidjson::GenericStringBuffer< RJ_Encoding, rapidjson::CrtAllocator > | RJ_StringBuffer |
typedef rapidjson::PrettyWriter< RJ_StringBuffer, RJ_Encoding, RJ_Encoding, RJ_Allocator, 0 > | RJ_PrettyWriter |
using | RJ_Writer = rapidjson::Writer< RJ_StringBuffer, RJ_Encoding, RJ_Encoding, RJ_Allocator, 0 > |
using | Sdi_writer = RJ_Writer |
Alias for the rapidjson Writer type to use in serialization. More... | |
typedef Stateless_allocator< char, String_type_alloc > | String_type_allocator |
template<class A > | |
using | Char_string_template = std::basic_string< char, std::char_traits< char >, A > |
Template alias for char-based std::basic_string. More... | |
typedef Char_string_template< String_type_allocator > | String_type |
template<class A > | |
using | Char_stringstream_template = std::basic_stringstream< char, std::char_traits< char >, A > |
Template alias for char-based std::basic_stringstream. More... | |
typedef Char_stringstream_template< String_type_allocator > | Stringstream_type |
Instantiation of std::basic_stringstream with the same allocator as String_type. More... | |
typedef std::vector< Tablespace_table_ref > | Tablespace_table_ref_vec |
Enumerations | |
enum class | enum_dd_init_type { DD_INITIALIZE = 1 , DD_INITIALIZE_SYSTEM_VIEWS , DD_RESTART_OR_UPGRADE , DD_POPULATE_UPGRADE , DD_DELETE , DD_UPDATE_I_S_METADATA , DD_INITIALIZE_NON_DD_BASED_SYSTEM_VIEWS } |
enum class | enum_table_type { INVALID_TABLE , BASE_TABLE , USER_VIEW , SYSTEM_VIEW } |
enum class | enum_column_types { DECIMAL = 1 , TINY , SHORT , LONG , FLOAT , DOUBLE , TYPE_NULL , TIMESTAMP , LONGLONG , INT24 , DATE , TIME , DATETIME , YEAR , NEWDATE , VARCHAR , BIT , TIMESTAMP2 , DATETIME2 , TIME2 , NEWDECIMAL , ENUM , SET , TINY_BLOB , MEDIUM_BLOB , LONG_BLOB , BLOB , VAR_STRING , STRING , GEOMETRY , JSON } |
enum class | enum_encryption_type { ET_NO = 1 , ET_YES } |
Functions | |
template<typename T > | |
static bool | item_compare (const T *a, const T *b) |
bool | init (enum_dd_init_type dd_init) |
Initialize data dictionary upon server startup, server startup on old data directory or install data dictionary for the first time. More... | |
bool | shutdown () |
Shuts down the data dictionary instance by deleting the instance of dd::Dictionary_impl* upon server shutdown. More... | |
class Dictionary * | get_dictionary () |
Get the data dictionary instance. More... | |
template<typename X > | |
X * | create_object () |
Create a instance of data dictionary object of type X. More... | |
int | get_old_status (Event::enum_event_status event_status) |
Convert new DD Event::enum_event_status to status type used in server code. More... | |
static Event::enum_event_status | get_enum_event_status (int event_status) |
Convert legacy event status to dd::Event::enum_event_status. More... | |
int | get_old_on_completion (Event::enum_on_completion on_completion) |
Convert new DD Event::enum_on_completion to completion type used in server code. More... | |
static Event::enum_on_completion | get_on_completion (int on_completion) |
Convert legacy event on completion behavior to dd::Event::enum_on_compeltion. More... | |
interval_type | get_old_interval_type (Event::enum_interval_field interval_field) |
Convert new DD interval_field type to type interval_type used in server code. More... | |
static Event::enum_interval_field | get_enum_interval_field (interval_type interval_type_val) |
Convert legacy interval type value to dd::Event::enum_interval_field. More... | |
static void | set_event_attributes (THD *thd, const dd::Schema &schema, Event *event, const String_type &event_name, const String_type &event_body, const String_type &event_body_utf8, const LEX_USER *definer, Event_parse_data *event_data, bool is_update) |
Set Event attributes. More... | |
bool | create_event (THD *thd, const Schema &schema, const String_type &event_name, const String_type &event_body, const String_type &event_body_utf8, const LEX_USER *definer, Event_parse_data *event_data) |
Create an event object and commit it to DD Table Events. More... | |
bool | update_event (THD *thd, Event *event, const dd::Schema &schema, const dd::Schema *new_schema, const String_type &new_event_name, const String_type &new_event_body, const String_type &new_event_body_utf8, const LEX_USER *definer, Event_parse_data *event_data) |
Create or update a event object and commit it to DD Table Events. More... | |
bool | update_event_time_and_status (THD *thd, Event *event, my_time_t last_executed, ulonglong status) |
Update time related fields of Event object. More... | |
bool | resource_group_exists (dd::cache::Dictionary_client *dd_client, const String_type &resource_group_name, bool *exists) |
Check if resource group exists in the data dictionary. More... | |
static bool | set_resource_group_attributes (dd::Resource_group *resource_group, const resourcegroups::Resource_group &res_grp_ref) |
bool | create_resource_group (THD *thd, const resourcegroups::Resource_group &res_grp_ref) |
Create a DD object and persist it to DD table resourcegroup. More... | |
bool | update_resource_group (THD *thd, const String_type &resource_grp_name, const resourcegroups::Resource_group &res_grp_ref) |
Update a resource group and persist it to DD table resourcegroup. More... | |
bool | drop_resource_group (THD *thd, const String_type resource_grp_name) |
Drop a resource group from DD table resourcegroup. More... | |
static void | fill_dd_function_return_type (THD *thd, sp_head *sp, Function *sf) |
Helper method for create_routine() to fill return type information of stored routine from the sp_head. More... | |
static void | fill_parameter_info_from_field (THD *thd, Create_field *field, dd::Parameter *param) |
Helper method for create_routine() to fill parameter information from the object of type Create_field. More... | |
static bool | fill_routine_parameters_info (THD *thd, sp_head *sp, Routine *routine) |
Helper method for create_routine() to fill parameters of routine to dd::Routine object from the sp_head. More... | |
static bool | fill_dd_routine_info (THD *thd, const dd::Schema &schema, sp_head *sp, Routine *routine, const LEX_USER *definer) |
Helper method for create_routine() to prepare dd::Routine object from the sp_head. More... | |
bool | create_routine (THD *thd, const Schema &schema, sp_head *sp, const LEX_USER *definer) |
Prepares dd:Routine object from sp_head and updates DD tables accordingly. More... | |
bool | alter_routine (THD *thd, Routine *routine, st_sp_chistics *chistics) |
Alters routine characteristics in the DD table. More... | |
bool | schema_exists (THD *thd, const char *schema_name, bool *exists) |
Check if given schema exists. More... | |
bool | create_schema (THD *thd, const char *schema_name, const CHARSET_INFO *charset_info, const bool default_encryption) |
Create a schema record into dd.schemata. More... | |
bool | mdl_lock_schema (THD *thd, const char *schema_name, enum_mdl_duration duration, MDL_ticket **ticket=nullptr) |
Acquire MDL on schema name. More... | |
dd::enum_column_types | get_new_field_type (enum_field_types type) |
Convert to and from new enum types in DD framework to current MySQL server enum types. More... | |
dd::String_type | get_sql_type_by_create_field (TABLE *table, const Create_field &field) |
Function returns string representing column type by Create_field. More... | |
static void | prepare_default_value_string (uchar *buf, TABLE *table, const Create_field &field, dd::Column *col_obj, String *def_value) |
Helper method to get default value of column in the string format. More... | |
bool | get_field_numeric_scale (const Create_field *field, uint *scale) |
Helper method to get numeric scale for types using Create_field type object. More... | |
bool | get_field_numeric_precision (const Create_field *field, uint *numeric_precision) |
Helper method to get numeric precision for types using Create_field type object. More... | |
bool | get_field_datetime_precision (const Create_field *field, uint *datetime_precision) |
Helper method to get datetime precision for types using Create_field type object. More... | |
static dd::String_type | now_with_opt_decimals (uint decimals) |
bool | fill_dd_columns_from_create_fields (THD *thd, dd::Abstract_table *tab_obj, const List< Create_field > &create_fields, handler *file) |
Add column objects to dd::Abstract_table according to list of Create_field objects. More... | |
static dd::Index::enum_index_algorithm | dd_get_new_index_algorithm_type (enum ha_key_alg type) |
static dd::Index::enum_index_type | dd_get_new_index_type (const KEY *key) |
static void | fill_dd_index_elements_from_key_parts (const dd::Table *tab_obj, dd::Index *idx_obj, uint key_part_count, const KEY_PART_INFO *key_parts, handler *file, bool is_primary_key) |
Add dd::Index_element objects to dd::Index/Table according to KEY_PART_INFO array for the index. More... | |
static bool | is_candidate_primary_key (THD *thd, const KEY *key, const List< Create_field > &create_fields) |
static void | fill_dd_indexes_from_keyinfo (THD *thd, dd::Table *tab_obj, uint key_count, const KEY *keyinfo, const List< Create_field > &create_fields, handler *file) |
Add index objects to dd::Table according to array of KEY structures. More... | |
static dd::Foreign_key::enum_rule | get_fk_rule (fk_option opt) |
Translate from the old fk_option enum to the new dd::Foreign_key::enum_rule enum. More... | |
static bool | fill_dd_foreign_keys_from_create_fields (dd::Table *tab_obj, uint key_count, const FOREIGN_KEY *keyinfo) |
Add foreign keys to dd::Table according to Foreign_key_spec structs. More... | |
template<typename T > | |
static bool | fill_dd_tablespace_id_or_name (THD *thd, T *obj, handlerton *hton, const char *tablespace_name, bool is_temporary_table) |
Set dd::Tablespace object id for dd::Table and dd::Partition object during CREATE TABLE. More... | |
static bool | get_field_list_str (dd::String_type &str, List< char > *name_list) |
Get a string of fields to be stores as partition_expression. More... | |
static void | set_partition_options (partition_element *part_elem, dd::Properties *part_options) |
Helper function to set partition options. More... | |
static bool | add_part_col_vals (partition_info *part_info, part_elem_value *list_value, uint list_index, dd::Partition *part_obj, const HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, String *part_desc_str) |
static void | collect_partition_expr (const THD *thd, List< char > &field_list, String *str) |
static bool | fill_dd_partition_from_create_info (THD *thd, dd::Table *tab_obj, const HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, partition_info *part_info) |
Fill in partitioning meta data form create_info to the table object. More... | |
bool | fill_dd_check_constraints (THD *thd, dd::Table *tab_obj, const Sql_check_constraint_spec_list *check_cons_spec) |
Fill in check constraints metadata to the Table object from the list of check constraint specifications. More... | |
static Table::enum_row_format | dd_get_new_row_format (row_type old_format) |
Convert old row type value to corresponding value in new row format enum used by DD framework. More... | |
static bool | engine_supports_provided_srs_id (THD *thd, const dd::Table &table, const handler *handler) |
Check if the storage engine supports geographic geometry columns. More... | |
bool | invalid_tablespace_usage (THD *thd, const dd::String_type &schema_name, const dd::String_type &table_name, const HA_CREATE_INFO *create_info) |
Checking if the table is being created in a restricted tablespace. More... | |
static bool | fill_dd_table_from_create_info (THD *thd, dd::Table *tab_obj, const dd::String_type &table_name, const dd::String_type &schema_name, const HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, const KEY *keyinfo, uint keys, Alter_info::enum_enable_or_disable keys_onoff, const FOREIGN_KEY *fk_keyinfo, uint fk_keys, const Sql_check_constraint_spec_list *check_cons_spec, handler *file) |
Fill dd::Table object from mysql_prepare_create_table() output. More... | |
static bool | get_se_private_data (THD *thd, dd::Table *tab_obj) |
Get the SE private data from the dd_properties table. More... | |
static std::unique_ptr< dd::Table > | create_dd_system_table (THD *thd, const dd::Schema &system_schema, const dd::String_type &table_name, HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, const KEY *keyinfo, uint keys, const FOREIGN_KEY *fk_keyinfo, uint fk_keys, const Sql_check_constraint_spec_list *check_cons_spec, handler *file, const dd::Object_table &dd_table) |
bool | is_server_ps_table_name (const dd::String_type &schema_name, const dd::String_type &table_name) |
std::unique_ptr< dd::Table > | create_dd_user_table (THD *thd, const dd::Schema &sch_obj, const dd::String_type &table_name, HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, const KEY *keyinfo, uint keys, Alter_info::enum_enable_or_disable keys_onoff, const FOREIGN_KEY *fk_keyinfo, uint fk_keys, const Sql_check_constraint_spec_list *check_cons_spec, handler *file) |
Prepares a dd::Table object from mysql_prepare_create_table() output and return it to the caller. More... | |
std::unique_ptr< dd::Table > | create_table (THD *thd, const dd::Schema &sch_obj, const dd::String_type &table_name, HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, const KEY *keyinfo, uint keys, Alter_info::enum_enable_or_disable keys_onoff, const FOREIGN_KEY *fk_keyinfo, uint fk_keys, const Sql_check_constraint_spec_list *check_cons_spec, handler *file) |
Prepares a dd::Table object from mysql_prepare_create_table() output and return it to the caller. More... | |
std::unique_ptr< dd::Table > | create_tmp_table (THD *thd, const dd::Schema &sch_obj, const dd::String_type &table_name, HA_CREATE_INFO *create_info, const List< Create_field > &create_fields, const KEY *keyinfo, uint keys, Alter_info::enum_enable_or_disable keys_onoff, const Sql_check_constraint_spec_list *check_cons_spec, handler *file) |
Prepares a dd::Table object for a temporary table from mysql_prepare_create_table() output. More... | |
bool | drop_table (THD *thd, const char *schema_name, const char *name, const dd::Table &table_def) |
bool | table_exists (dd::cache::Dictionary_client *client, const char *schema_name, const char *name, bool *exists) |
Check if a table or view exists. More... | |
bool | is_generated_foreign_key_name (const char *table_name, size_t table_name_length, handlerton *hton, const dd::Foreign_key &fk) |
Check if foreign key name is generated one. More... | |
static bool | is_foreign_key_name_locked (THD *thd, const char *db, const char *fk_name) |
bool | rename_foreign_keys (THD *thd, const char *old_db, const char *old_table_name, handlerton *hton, const char *new_db, dd::Table *new_tab) |
Rename foreign keys which have generated names to match the new name of the table. More... | |
bool | table_legacy_db_type (THD *thd, const char *schema_name, const char *table_name, enum legacy_db_type *db_type) |
Get the legacy db type from the options of the given table. More... | |
template<typename T > | |
bool | table_storage_engine (THD *thd, const T *obj, handlerton **hton) |
Get the storage engine handlerton for the given table or tablespace. More... | |
template bool | table_storage_engine< dd::Table > (THD *, const dd::Table *, handlerton **) |
template bool | table_storage_engine< dd::Tablespace > (THD *, const dd::Tablespace *, handlerton **) |
bool | recreate_table (THD *thd, const char *schema_name, const char *table_name) |
Regenerate a metadata locked table. More... | |
dd::String_type | get_sql_type_by_field_info (THD *thd, enum_field_types field_type, uint32 field_length, uint32 decimals, bool maybe_null, bool is_unsigned, const CHARSET_INFO *field_charset) |
Function returns string representing column type by ST_FIELD_INFO. More... | |
bool | fix_row_type (THD *thd, dd::Table *table, row_type correct_row_type) |
Update row format for the table with the value value supplied by caller function. More... | |
void | report_error_as_tablespace_missing (Object_id id) |
void | report_error_as_tablespace_missing (const String_type name) |
template<typename KEY > | |
bool | is_general_tablespace_and_encrypted (const KEY k, THD *thd, bool *is_encrypted_tablespace, bool *is_general_tablespace) |
Encrypt_result | is_tablespace_encrypted (THD *thd, const Table &t, bool *is_general_tablespace) |
Predicate to determine if a table resides in an encrypted tablespace. More... | |
bool | has_primary_key (const Table &t) |
Predicate which indicates if the table has real (non-hidden) primary key. More... | |
bool | is_generated_check_constraint_name (const char *table_name, size_t table_name_length, const char *cc_name, size_t cc_name_length) |
Check if name of check constraint is generated one. More... | |
bool | rename_check_constraints (const char *old_table_name, dd::Table *new_tab) |
Rename generated check constraint names to match the new name of the table. More... | |
template<typename IT > | |
static void | copy_tablespace_names (const HA_CREATE_INFO *ci, partition_info *pi, IT it) |
Encrypt_result | is_tablespace_encrypted (THD *thd, const HA_CREATE_INFO *ci, bool *is_general_tablespace) |
Predicate to determine if a table resides in an encrypted tablespace and if it a general tablespace. More... | |
bool | uses_general_tablespace (const Table &t) |
Check if table uses general tablespace. More... | |
void | warn_on_deprecated_prefix_key_partition (THD *thd, const char *schema_name, const char *orig_table_name, const Table *table, const bool is_upgrade) |
Throw deprecation warnings if table uses prefix keys in the partitioning function. More... | |
bool | get_implicit_tablespace_options (THD *thd, const Table *table, ulonglong *autoextend_size) |
Get the autoextend_size option value for implicit tablespaces. More... | |
bool | is_encrypted (const String_type &type) |
bool | is_encrypted (const LEX_STRING &type) |
bool | fill_table_and_parts_tablespace_names (THD *thd, const char *db_name, const char *table_name, Tablespace_hash_set *tablespace_set) |
Fill Tablespace_hash_set with tablespace names used by the given db_name.table_name. More... | |
template<typename T > | |
bool | get_tablespace_name (THD *thd, const T *obj, String_type *name) |
Read tablespace name of a tablespace_id from Table or similar object. More... | |
template<typename T > | |
bool | get_tablespace_name (THD *thd, const T *obj, const char **tablespace_name, MEM_ROOT *mem_root) |
Read tablespace name of a tablespace_id. More... | |
static Trigger::enum_event_type | get_dd_event_type (const ::Trigger *new_trigger) |
Get DD API value of event type for a trigger. More... | |
static Trigger::enum_action_timing | get_dd_action_timing (const ::Trigger *new_trigger) |
Get DD API value of action timing for a trigger. More... | |
static bool | fill_in_dd_trigger_object (const ::Trigger *new_trigger, Trigger *dd_trig_obj) |
Fill in a dd::Trigger object based on a Trigger object supplied by sql-layer. More... | |
bool | create_trigger (THD *thd, const ::Trigger *new_trigger, enum_trigger_order_type ordering_clause, const LEX_CSTRING &referenced_trigger_name) |
Create new trigger in the data dictionary. More... | |
static enum_trigger_event_type | convert_event_type_from_dd (dd::Trigger::enum_event_type event_type) |
Convert event type value from DD presentation to generic SQL presentation. More... | |
static enum_trigger_action_time_type | convert_action_time_from_dd (dd::Trigger::enum_action_timing action_timing) |
Convert action timing value from DD presentation to generic SQL presentation. More... | |
bool | load_triggers (THD *thd, MEM_ROOT *mem_root, const char *schema_name, const char *table_name, const dd::Table &table, List<::Trigger > *triggers) |
Load table triggers from the data dictionary. More... | |
bool | table_has_triggers (THD *thd, const char *schema_name, const char *table_name, bool *table_has_trigger) |
Check in the data dictionary if there is any trigger associated with a table. More... | |
size_t | normalize_string (const CHARSET_INFO *cs, const String_type &src, char *normalized_str_buf, size_t normalized_str_buf_length) |
Normalize (or transform) the multibyte character set string. More... | |
bool | check_if_server_ddse_readonly (THD *thd, const char *schema_name=nullptr) |
Check if DDSE (Data Dictionary Storage Engine) is in readonly mode. More... | |
static ulonglong | dd_get_old_view_check_type (dd::View::enum_check_option type) |
static dd::View::enum_check_option | dd_get_new_view_check_type (ulonglong type) |
For enum in dd::View. More... | |
static enum enum_view_algorithm | dd_get_old_view_algorithm_type (dd::View::enum_algorithm type) |
static dd::View::enum_algorithm | dd_get_new_view_algorithm_type (enum enum_view_algorithm type) |
static ulonglong | dd_get_old_view_security_type (dd::View::enum_security_type type) |
static dd::View::enum_security_type | dd_get_new_view_security_type (ulonglong type) |
static bool | fill_dd_view_columns (THD *thd, View *view_obj, const Table_ref *view) |
Method to fill view columns from the first Query_block of view query. More... | |
static void | fill_dd_view_tables (View *view_obj, const Table_ref *view, const Table_ref *query_tables) |
Method to fill base table and view names used by view query in DD View object. More... | |
static void | fill_dd_view_routines (View *view_obj, Query_tables_list *routines_ctx) |
Method to fill view routines from the set of routines used by view query. More... | |
static bool | fill_dd_view_definition (THD *thd, View *view_obj, Table_ref *view) |
Method to fill view information in the View object. More... | |
bool | update_view (THD *thd, dd::View *new_view, Table_ref *view) |
Update view metadata in dd.views. More... | |
bool | create_view (THD *thd, const dd::Schema &schema, Table_ref *view) |
Store view metadata in the data-dictionary. More... | |
bool | read_view (Table_ref *view, const dd::View &view_ref, MEM_ROOT *mem_root) |
Read view metadata from dd.views into Table_ref. More... | |
bool | update_view_status (THD *thd, const char *schema_name, const char *view_name, bool status, bool commit_dd_changes) |
Update view status(valid/invalid) value in dd.views.options. More... | |
bool | acquire_shared_table_mdl (THD *thd, const char *schema_name, const char *table_name, bool no_wait, MDL_ticket **out_mdl_ticket) |
Acquire shared metadata lock on the given table name with explicit duration. More... | |
bool | has_shared_table_mdl (THD *thd, const char *schema_name, const char *table_name) |
Predicate to check if we have a shared meta data lock on the submitted schema qualified table name. More... | |
bool | has_exclusive_table_mdl (THD *thd, const char *schema_name, const char *table_name) |
Predicate to check if we have an exclusive meta data lock on the submitted schema qualified table name. More... | |
bool | acquire_exclusive_tablespace_mdl (THD *thd, const char *tablespace_name, bool no_wait, MDL_ticket **ticket=nullptr, bool for_trx=true) |
Acquire an exclusive metadata lock on the given tablespace name with transaction duration. More... | |
bool | acquire_shared_tablespace_mdl (THD *thd, const char *tablespace_name, bool no_wait, MDL_ticket **ticket=nullptr, bool for_trx=true) |
Acquire a shared metadata lock on the given tablespace name with transaction duration. More... | |
bool | has_shared_tablespace_mdl (THD *thd, const char *tablespace_name) |
Predicate to check if we have a shared meta data lock on the submitted tablespace name. More... | |
bool | has_exclusive_tablespace_mdl (THD *thd, const char *tablespace_name) |
Predicate to check if we have an exclusive meta data lock on the submitted tablespace name. More... | |
bool | acquire_exclusive_table_mdl (THD *thd, const char *schema_name, const char *table_name, bool no_wait, MDL_ticket **out_mdl_ticket) |
Acquire exclusive metadata lock on the given table name with TRANSACTIONAL duration. More... | |
bool | acquire_exclusive_table_mdl (THD *thd, const char *schema_name, const char *table_name, unsigned long int lock_wait_timeout, MDL_ticket **out_mdl_ticket) |
Acquire exclusive metadata lock on the given table name with TRANSACTIONAL duration. More... | |
bool | acquire_exclusive_schema_mdl (THD *thd, const char *schema_name, bool no_wait, MDL_ticket **out_mdl_ticket) |
Acquire exclusive metadata lock on the given schema name with explicit duration. More... | |
void | release_mdl (THD *thd, MDL_ticket *mdl_ticket) |
Release MDL_EXPLICIT lock held by a ticket. More... | |
cache::Dictionary_client * | get_dd_client (THD *thd) |
Get Dictionary_client from THD object (the latter is opaque * in SEs). More... | |
bool | create_native_table (THD *thd, const Plugin_table *pt) |
Create plugin native table. More... | |
bool | drop_native_table (THD *thd, const char *schema_name, const char *table_name) |
Remove plugin native table from DD. More... | |
bool | reset_tables_and_tablespaces () |
Reset the tables and tablespace partitions in the DD cache, and invalidate the entries in the DDSE cache. More... | |
bool | commit_or_rollback_tablespace_change (THD *thd, dd::Tablespace *space, bool error, bool release_mdl_on_commit_only=false) |
Update a tablespace change, commit and release transactional MDL. More... | |
template<typename Entity_object_type > | |
const Object_table & | get_dd_table () |
Get the Object_table instance storing the given entity object type. More... | |
void | rename_tablespace_mdl_hook (THD *thd, MDL_ticket *src, MDL_ticket *dst) |
Implicit tablespaces are renamed inside SE. More... | |
bool | alter_tablespace_encryption (THD *thd, const char *tablespace_name, bool encryption) |
Execute an ALTER TABLESPACE ... ENCRYPTION statement. More... | |
void | store_predefined_tablespace_metadata (THD *thd) |
This function creates the meta data of the predefined tablespaces. More... | |
bool | create_dd_schema (THD *thd) |
Executes SQL queries to create and use the dictionary schema. More... | |
bool | getprop (THD *thd, const char *key, uint *value, bool silent=false) |
bool | getprop (THD *thd, const char *key, String_type *value, bool silent=false) |
bool | setprop (THD *thd, const char *key, const uint value, bool silent=false) |
bool | setprop (THD *thd, const char *key, const String_type &value, bool silent=false) |
bool | initialize_dd_properties (THD *thd) |
During –initialize, we create the dd_properties table. More... | |
bool | is_non_inert_dd_or_ddse_table (System_tables::Types table_type) |
Predicate to check if a table type is a non-inert DD or a DDSE table. More... | |
bool | create_tables (THD *thd, const std::set< String_type > *create_set) |
Execute SQL statements to create the DD tables. More... | |
bool | sync_meta_data (THD *thd) |
Acquire the DD schema, tablespace and table objects. More... | |
bool | update_properties (THD *thd, const std::set< String_type > *create_set, const std::set< String_type > *remove_set, const String_type &target_table_schema_name) |
Update properties in the DD_properties table. More... | |
bool | update_versions (THD *thd, bool is_dd_upgrade_57) |
Updates the DD Version in the DD_properties table to the current version. More... | |
template Charset_impl * | create_object< Charset_impl > () |
template Collation * | create_object< Collation > () |
template Collation_impl * | create_object< Collation_impl > () |
template Column * | create_object< Column > () |
template Column_statistics * | create_object< Column_statistics > () |
template Column_type_element * | create_object< Column_type_element > () |
template Event * | create_object< Event > () |
template Function * | create_object< Function > () |
template Foreign_key * | create_object< Foreign_key > () |
template Foreign_key_element * | create_object< Foreign_key_element > () |
template Index * | create_object< Index > () |
template Index_element * | create_object< Index_element > () |
template Index_stat * | create_object< Index_stat > () |
template Partition * | create_object< Partition > () |
template Partition_index * | create_object< Partition_index > () |
template Partition_value * | create_object< Partition_value > () |
template Procedure * | create_object< Procedure > () |
template Resource_group * | create_object< Resource_group > () |
template Schema * | create_object< Schema > () |
template Spatial_reference_system * | create_object< Spatial_reference_system > () |
template Table * | create_object< Table > () |
template Table_stat * | create_object< Table_stat > () |
template Tablespace * | create_object< Tablespace > () |
template Tablespace_file * | create_object< Tablespace_file > () |
template View * | create_object< View > () |
static bool | acquire_shared_mdl (THD *thd, MDL_key::enum_mdl_namespace lock_namespace, const char *schema_name, const char *table_name, bool no_wait, ulong lock_wait_timeout, enum_mdl_duration lock_duration, MDL_ticket **out_mdl_ticket) |
static bool | acquire_exclusive_mdl (THD *thd, MDL_key::enum_mdl_namespace lock_namespace, const char *schema_name, const char *table_name, bool no_wait, ulong lock_wait_timeout, enum_mdl_duration lock_duration, MDL_ticket **out_mdl_ticket) |
template const Object_table & | get_dd_table< dd::Column > () |
template const Object_table & | get_dd_table< dd::Index > () |
template const Object_table & | get_dd_table< dd::Partition > () |
template const Object_table & | get_dd_table< dd::Table > () |
template const Object_table & | get_dd_table< dd::Tablespace > () |
char * | buf_handle (Sdi_wcontext *wctx, size_t sz) |
Return a non-owning pointer to a char buffer which can be used for e.g. More... | |
const String_type & | lookup_schema_name (Sdi_wcontext *wctx) |
Returns const reference to string holding schema name to use in SDI. More... | |
template<typename T > | |
String_type | generic_serialize (THD *thd, const char *dd_object_type, size_t dd_object_type_size, const T &dd_obj, const String_type *schema_name) |
const String_type & | lookup_tablespace_name (Sdi_wcontext *wctx, dd::Object_id id) |
Look up the tablespace name for a tablespace id. More... | |
template<typename T > | |
void | generic_track_object (dd_vector< T * > *tvp, T *t) |
void | track_object (Sdi_rcontext *rctx, Column *column_object) |
Register Column objects being deserialized so that it will be possible to resolve references to it after deserialization has finished. More... | |
void | track_object (Sdi_rcontext *rctx, Index *index_object) |
Register Index objects being deserialized so that it will be possible to resolve references to it after deserialization has finished. More... | |
Index * | get_by_opx (Sdi_rcontext *rctx, const Index *, uint opx) |
Return an non-owning raw pointer to the deserialized Index object with ordinal position index opx (ordinal position opx+1). More... | |
Column * | get_by_opx (Sdi_rcontext *rctx, const Column *, uint opx) |
Return an non-owning raw pointer to the deserialized Column object with ordinal position index opx (ordinal position opx+1). More... | |
char * | buf_handle (Sdi_rcontext *rctx, size_t sz) |
Return a non-owning pointer to a char buffer which can be used for e.g. More... | |
template<typename T > | |
bool | generic_lookup_ref (THD *thd, MDL_key::enum_mdl_namespace mdlns, const String_type &name, dd::Object_id *idp) |
bool | lookup_schema_ref (Sdi_rcontext *rctx, const String_type &name, Object_id *idp) |
Return the the Object_id of a schema name in the current data dictionary. More... | |
bool | lookup_tablespace_ref (Sdi_rcontext *rctx, const String_type &name, Object_id *idp) |
Return the the Object_id of a tablespace name in the current data dictionary. More... | |
Sdi_type | serialize (const Schema &schema) |
Serialize a Schema object. More... | |
bool | deserialize (THD *thd, const Sdi_type &sdi, Table *table, String_type *deser_schema_name=nullptr) |
Deserialize a dd::Table object. More... | |
bool | deserialize (THD *thd, const Sdi_type &sdi, Tablespace *tablespace) |
Deserialize a dd::Tablespace object. More... | |
Properties * | parse_properties (const String_type &str) |
Factory function for creating a Property object from String_type. More... | |
static bool | is_valid_cpu_mask_str (const String_type &str) |
Check if the string contain characters of 0 and 1. More... | |
bool | operator== (const Tablespace_table_ref &a, const Tablespace_table_ref &b) |
bool | operator< (const Tablespace_table_ref &a, const Tablespace_table_ref &b) |
bool | fetch_tablespace_table_refs (THD *thd, const Tablespace &tso, Tablespace_table_ref_vec *tblrefs) |
Fetch (by inserting into tblref vector) Tablespace_table_ref objects which describe tables in a given tablespace. More... | |
MDL_request * | mdl_req (THD *thd, const Tablespace_table_ref &tref, enum enum_mdl_type mdl_type) |
Create am MDL_request for a the table identified by a Tablespace_table_ref. More... | |
MDL_request * | mdl_schema_req (THD *thd, const dd::String_type &schema_name) |
Create am MDL_request for a the schema name provided. More... | |
bool | execute_query (THD *thd, const dd::String_type &q_buf) |
Create a lex string for the query from the string supplied and execute the query. More... | |
void | escape (String_type *dst, const String_type &src) |
Escaping of a String_type. More... | |
bool | unescape (String_type &dest) |
In place unescaping of String_type. More... | |
bool | eat_to (String_type::const_iterator &it, String_type::const_iterator end, char c) |
Start at it, iterate until we hit an unescaped c or the end of the string. More... | |
bool | eat_str (String_type &dest, String_type::const_iterator &it, String_type::const_iterator end, char c) |
Start at it, find first unescaped occorrence of c, create destination string and copy substring to destination. More... | |
bool | eat_pairs (String_type::const_iterator &it, String_type::const_iterator end, dd::Properties *props) |
Start at it, find a key and value separated by an unescaped '='. More... | |
ulonglong | my_time_t_to_ull_datetime (my_time_t seconds_since_epoch) |
Convert seconds since epoch, to a datetime ulonglong using my_tz_OFFSET0 suitable for timestamp fields in the DD. More... | |
bool | is_string_in_lowercase (const String_type &str, const CHARSET_INFO *cs) |
Method to verify if string is in lowercase. More... | |
bool | end_transaction (THD *thd, bool error) |
Helper function to do rollback or commit, depending on error. More... | |
template<typename LEX_STRING_TYPE > | |
String_type | make_string_type (const LEX_STRING_TYPE &lst) |
template<class VISITOR_TYPE > | |
bool | visit_tablespace_id_owners (const Partition &p, VISITOR_TYPE &&visitor) |
Visitor function which invokes its visitor argument on any subobject which holds a tablespace, that is, the partition itself, its Partition_indexes, its sub-partitions, and Partition_indexes of those. More... | |
template<class VISITOR_TYPE > | |
bool | visit_tablespace_id_owners (const Table &t, VISITOR_TYPE &&visitor) |
Visitor function which invokes its visitor argument on any subobject which holds a tablespace, that is, the table itself, its m_indexes, its m_partitions, and m_indexes (Partition_index) of each partition and sub-partition. More... | |
bool | is_checked_for_upgrade (const Table &t) |
Sdi_type | serialize (THD *thd, const Table &table, const String_type &schema_name) |
Serialize a Table object. More... | |
Sdi_type | serialize (const Tablespace &tablespace) |
Serialize a Tablespace object. More... | |
bool | CheckDefaultCompatibility (const RJ_Document &doc) |
Default checker which implements the traditional (strict) compatibility check: MYSQL_VERSION less than or equal, dd_version equal, and sdi_version equal. More... | |
template<class Dd_type > | |
bool | generic_deserialize (THD *thd, const Sdi_type &sdi, const String_type &object_type_name, Dd_type *dst, const SdiCompatibilityChecker &comp_checker, String_type *schema_name_from_sdi) |
bool | deserialize (THD *thd, const Sdi_type &sdi, Table *dst_table, SdiCompatibilityChecker comp_checker, String_type *deser_schema_name) |
Deserialize a dd::Table object. More... | |
bool | deserialize (THD *thd, const Sdi_type &sdi, Tablespace *dst_tablespace, SdiCompatibilityChecker comp_checker) |
Deserialize a dd::Tablespace object. More... | |
Variables | |
static const char * | failsafe_object = "Event status option" |
static const char | FIELD_NAME_SEPARATOR_CHAR = ';' |
static const char | CHECK_CONSTRAINT_NAME_SUBSTR [] = "_chk_" |
static const uint | DD_VERSION = 80023 |
static const uint | DD_VERSION_MINOR_DOWNGRADE_THRESHOLD = DD_VERSION |
If a new DD version is published in a MRU, that version may or may not be possible to downgrade to previous MRUs within the same GA. More... | |
constexpr uint | SERVER_DOWNGRADE_THRESHOLD = 0 |
A new release model supporting Long Term Stability (LTS) and innovation releases is being introduced. More... | |
constexpr uint | SERVER_UPGRADE_THRESHOLD = 0 |
The new release model explained above will also open the possibility of upgrading to a version that has been released in the past. More... | |
constexpr const std::uint64_t | SDI_VERSION = 80019 |
The version of the current SDI Json format. More... | |
static const std::set< String_type > | default_valid_option_keys |
static const std::set< String_type > | default_valid_option_keys |
static const std::set< String_type > | default_valid_option_keys |
static const std::set< String_type > | default_valid_option_keys = {"geom_type"} |
static const std::set< String_type > | default_valid_option_keys |
static const std::set< String_type > | default_valid_option_keys = {"read_only"} |
static const std::set< String_type > | default_valid_option_keys |
const Object_id | INVALID_OBJECT_ID = (Object_id)-1 |
The default object ID which represents that the DD object is new and not persistent in dictionary tables yet. More... | |
static constexpr int | CPU_MASK_SIZE = 1024 |
The version of the current data dictionary table definitions.
Data dictionary initialization.
This version number is stored on disk in the data dictionary. Every time the data dictionary schema structure changes, this version number must change. The table that stores the data dictionary version number is never allowed to change.
The data dictionary version number is the MySQL server version number of the first MySQL server version that published a given database schema. The format is Mmmdd with M=Major, m=minor, d=dot, so that MySQL 8.0.4 is encoded as 80004. This is the same version numbering scheme as the information schema and performance schema are using.
When a data dictionary version is made public, the next change to a dictionary table will be associated with the next available MySQL server version number. So if DD version 80004 is made available in MySQL 8.0.4, and 8.0.5 is an MRU with no changes to the DD tables, then the DD version will stay 80004 also in MySQL 8.0.5. If MySQL 9.0.4 is the first GA of 9.0, and if there are no changes to the DD tables compared to 8.0.4, then the DD version number will stay 80004 also in MySQL 9.0.4. Then, if there are changes to the DD tables after MySQL 9.0.4, then the new DD version will be 90005. In day to day builds internally, changes to the DD tables may be done incrementally, so there may be different builds having the same DD version number, yet with different DD table definitions.
Historical version number published in the data dictionary:
Introduced in MySQL 8.0.0 by WL#6378. Never published in a GA version. Last changes were:
Changes from version 1:
WL#9553: Added new 'options' column to the following DD tables: catalogs, character_sets, collations, column_statistics, events, foreign_keys, resource_groups, routines, schemata, st_spatial_reference_systems, triggers.
(Other relevant DD tables have this column already: columns, indexes, parameters, tables, tablespaces).
Also added explicit indexes for foreign keys instead of relying on these to be created implicitly for the following tables/columns: character_sets.default_collation_id, collations.character_set_id, columns.collation_id, columns.srs_id, events.client_collation_id, events.connection_collation_id, events.schema_collation_id, foreign_key_column_usage.column_id, index_column_usage.column_id, index_partitions.index_id, index_partitions.tablespace_id, indexes.tablespace_id, parameters.collation_id, routines.result_collation_id, routines.client_collation_id, routines.connection_collation_id, routines.schema_collation_id, schemata.default.collation_id, table_partitions.tablespace_id, tables.collation_id, tables.tablespace_id, triggers.client_collation_id, triggers.connection_collation_id, triggers.schema_collation_id,
Changes from version 80004:
external_language
to mysql
.routines
and update information_schema
.routines
to reflect this column.Changes from version 80011:
Changes from version 80012:
Changes from version 80013:
No changes from version 80014.
Changes from version 80014:
Changes from version 80016:
Changes from version 80017:
Changes from version 80021:
Changes from version 80022:
Changes from version 80023:
The data dictionary is initialized whenever the mysqld process starts. We distinguish between the first time start and the subsequent normal restarts/upgrades, as explained below. However, there are three main design principles that should be elaborated first.
Fake caching: As a consequence of keeping instrumentation at a minimum, we provide uniform behavior of the caching layer in the data dictionary also in the scaffolding phase. This means that as seen from the outside, dictionary objects can be retrieved from the cache. Internally, below the caching layer, the objects are only kept in a separate buffer until all the required scaffolding is built. At that point, we can start using the underlying physical tables, depending on the circumstances:
After the scaffolding has been flushed or synced, what should be left is a collection of the core DD meta data objects. This collection is located in the storage adapter, and allows the DD cache to evict core DD objects in the same way as other DD objects.
Please note that dictionary initialization is only a small part of server initialization. There is a lot going on before and after dictionary initialization while starting the server.
Please see more elaborated descriptions for the initialize() and restart() methods below.
using dd::Char_string_template = typedef std::basic_string<char, std::char_traits<char>, A> |
Template alias for char-based std::basic_string.
using dd::Char_stringstream_template = typedef std::basic_stringstream<char, std::char_traits<char>, A> |
Template alias for char-based std::basic_stringstream.
typedef ResultType< bool > dd::Encrypt_result |
typedef unsigned long long dd::Object_id |
typedef rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> dd::RJ_Allocator |
typedef rapidjson::GenericDocument<RJ_Encoding, RJ_Allocator, rapidjson::CrtAllocator> dd::RJ_Document |
typedef rapidjson::UTF8<char> dd::RJ_Encoding |
typedef rapidjson::PrettyWriter<RJ_StringBuffer, RJ_Encoding, RJ_Encoding, RJ_Allocator, 0> dd::RJ_PrettyWriter |
typedef rapidjson::GenericStringBuffer<RJ_Encoding, rapidjson::CrtAllocator> dd::RJ_StringBuffer |
typedef rapidjson::GenericValue<RJ_Encoding, RJ_Allocator> dd::RJ_Value |
using dd::RJ_Writer = typedef rapidjson::Writer<RJ_StringBuffer, RJ_Encoding, RJ_Encoding, RJ_Allocator, 0> |
typedef String_type dd::Sdi_type |
using dd::Sdi_writer = typedef RJ_Writer |
Alias for the rapidjson Writer type to use in serialization.
Can be changeed to RJ_PrettyWriter to get human-readable (but significatly larger) sdis.
typedef Stateless_allocator<char, String_type_alloc> dd::String_type_allocator |
Instantiation of std::basic_stringstream with the same allocator as String_type.
This is needed since a std::basic_stringstream::str() returns a basic_string allocated with its own allocator. Note that this also means that it is difficult to use a different PSI key for the stream memory as that would mean the return type of Stringstream_type::str() would be different and incompatible with String_type.
To work around this would require the creation of a temporary String_type from the string returned from stringstream::str().
typedef std::vector<Tablespace_table_ref> dd::Tablespace_table_ref_vec |
using dd::Weak_object_impl = typedef Weak_object_impl_<true> |
|
strong |
|
strong |
|
strong |
|
strong |
|
static |
bool dd::acquire_exclusive_schema_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
bool | no_wait, | ||
MDL_ticket ** | out_mdl_ticket | ||
) |
Acquire exclusive metadata lock on the given schema name with explicit duration.
[in] | thd | THD to which lock belongs to. |
[in] | schema_name | Schema name |
[in] | no_wait | Use try_acquire_lock() if no_wait is true. else use acquire_lock() with thd->variables.lock_wait_timeout timeout value. |
[out] | out_mdl_ticket | A pointer to MDL_ticket upon successful lock attempt. |
bool dd::acquire_exclusive_table_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name, | ||
bool | no_wait, | ||
MDL_ticket ** | out_mdl_ticket | ||
) |
Acquire exclusive metadata lock on the given table name with TRANSACTIONAL duration.
[in] | thd | THD to which lock belongs to. |
[in] | schema_name | Schema name |
[in] | table_name | Table name |
[in] | no_wait | Use try_acquire_lock() if no_wait is true. else use acquire_lock() with thd->variables.lock_wait_timeout timeout value. |
[out] | out_mdl_ticket | A pointer to MDL_ticket upon successful lock attempt. |
bool dd::acquire_exclusive_table_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name, | ||
unsigned long int | lock_wait_timeout, | ||
MDL_ticket ** | out_mdl_ticket | ||
) |
Acquire exclusive metadata lock on the given table name with TRANSACTIONAL duration.
[in] | thd | THD to which lock belongs to. |
[in] | schema_name | Schema name |
[in] | table_name | Table name |
[in] | lock_wait_timeout | Time to wait. |
[out] | out_mdl_ticket | A pointer to MDL_ticket upon successful lock attempt. |
bool dd::acquire_exclusive_tablespace_mdl | ( | THD * | thd, |
const char * | tablespace_name, | ||
bool | no_wait, | ||
MDL_ticket ** | ticket = nullptr , |
||
bool | for_trx = true |
||
) |
Acquire an exclusive metadata lock on the given tablespace name with transaction duration.
thd | THD to which lock belongs. |
tablespace_name | Tablespace name |
no_wait | Use try_acquire_lock() if no_wait is true, else use acquire_lock() with thd->variables.lock_wait_timeout timeout value. |
ticket | ticket for request (optional out parameter) |
for_trx | true if MDL duration is MDL_TRANSACTION false if MDL duration is MDL_EXPLICIT |
true | Failure, e.g. a lock wait timeout. |
false | Successful lock acquisition. |
|
static |
bool dd::acquire_shared_table_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name, | ||
bool | no_wait, | ||
MDL_ticket ** | out_mdl_ticket | ||
) |
Acquire shared metadata lock on the given table name with explicit duration.
thd | - THD to which lock belongs to. |
schema_name | - Schema name |
table_name | - Table name |
no_wait | - Use try_acquire_lock() if no_wait is true. else use acquire_lock() with thd->variables.lock_wait_timeout timeout value. |
out_mdl_ticket | - This is a OUT parameter, a pointer to MDL_ticket upon successful lock attempt. |
bool dd::acquire_shared_tablespace_mdl | ( | THD * | thd, |
const char * | tablespace_name, | ||
bool | no_wait, | ||
MDL_ticket ** | ticket = nullptr , |
||
bool | for_trx = true |
||
) |
Acquire a shared metadata lock on the given tablespace name with transaction duration.
thd | THD to which lock belongs. |
tablespace_name | Tablespace name |
no_wait | Use try_acquire_lock() if no_wait is true, else use acquire_lock() with thd->variables.lock_wait_timeout timeout value. |
ticket | ticket for request (optional out parameter) |
for_trx | true if MDL duration is MDL_TRANSACTION false if MDL duration is MDL_EXPLICIT |
true | Failure, e.g. a lock wait timeout. |
false | Successful lock acquisition. |
|
static |
bool dd::alter_routine | ( | THD * | thd, |
Routine * | routine, | ||
st_sp_chistics * | chistics | ||
) |
Alters routine characteristics in the DD table.
[in] | thd | Thread handle. |
[in] | routine | Procedure or Function to alter. |
[in] | chistics | New values of stored routine attributes to write. |
false | ON SUCCESS |
true | ON FAILURE |
bool dd::alter_tablespace_encryption | ( | THD * | thd, |
const char * | tablespace_name, | ||
bool | encryption | ||
) |
Execute an ALTER TABLESPACE ... ENCRYPTION statement.
During recovery of a storage engine, an ALTER TABLESPACE ... ENCRYPTION statement may be resumed. This is initiated from the SE, which will first set the state as appropriate in the SE, then invoke this method to start executing the statement. When the SE is involved during execution of the statement, the internal state in the SE will indicate that this is a statement that has been initiated and partially executed already.
thd | Thread context. |
tablespace_name | Name of tablespace to encrypt/decrypt. |
encryption | True to turn on encryption, false to turn off. |
false | if no errors, otherwise true. |
char * dd::buf_handle | ( | Sdi_rcontext * | rctx, |
size_t | sz | ||
) |
Return a non-owning pointer to a char buffer which can be used for e.g.
base64 encoding.
rctx | opaque context |
sz | size of buffer |
char * dd::buf_handle | ( | Sdi_wcontext * | wctx, |
size_t | sz | ||
) |
Return a non-owning pointer to a char buffer which can be used for e.g.
base64 encoding.
wctx | opaque context. |
sz | size of buffer. |
Check if DDSE (Data Dictionary Storage Engine) is in readonly mode.
thd | Thread |
schema_name | Abbreviation or name of schema (I_S, P_S, ndbinfo) for use in warning message output; nullptr if no warning should be emitted |
|
static |
bool dd::commit_or_rollback_tablespace_change | ( | THD * | thd, |
dd::Tablespace * | space, | ||
bool | error, | ||
bool | release_mdl_on_commit_only = false |
||
) |
Update a tablespace change, commit and release transactional MDL.
[in,out] | thd | Current thread context. |
[in,out] | space | Tablespace to update and commit. |
[in] | error | true for failure: Do rollback. false for success: Do commit. |
[in] | release_mdl_on_commit_only | release MDLs only on commit |
true | If error is true, or if failure in update or in commit. |
false | Otherwise. |
|
static |
Convert action timing value from DD presentation to generic SQL presentation.
[in] | action_timing | Action timing value from the Data Dictionary |
|
static |
Convert event type value from DD presentation to generic SQL presentation.
[in] | event_type | Event type value from the Data Dictionary |
|
static |
bool dd::create_dd_schema | ( | THD * | thd | ) |
Executes SQL queries to create and use the dictionary schema.
thd | Thread context. |
|
static |
std::unique_ptr< dd::Table > dd::create_dd_user_table | ( | THD * | thd, |
const dd::Schema & | sch_obj, | ||
const dd::String_type & | table_name, | ||
HA_CREATE_INFO * | create_info, | ||
const List< Create_field > & | create_fields, | ||
const KEY * | keyinfo, | ||
uint | keys, | ||
Alter_info::enum_enable_or_disable | keys_onoff, | ||
const FOREIGN_KEY * | fk_keyinfo, | ||
uint | fk_keys, | ||
const Sql_check_constraint_spec_list * | check_cons_spec, | ||
handler * | file | ||
) |
Prepares a dd::Table object from mysql_prepare_create_table() output and return it to the caller.
This function creates a user table, as opposed to create_table() which can handle system tables as well.
thd | Thread handle |
sch_obj | Schema. |
table_name | Table name. |
create_info | HA_CREATE_INFO describing the table to be created. |
create_fields | List of fields for the table. |
keyinfo | Array with descriptions of keys for the table. |
keys | Number of keys. |
keys_onoff | keys ON or OFF |
fk_keyinfo | Array with descriptions of foreign keys for the table. |
fk_keys | Number of foreign keys. |
check_cons_spec | Specification of check constraints for the table. |
file | handler instance for the table. |
bool dd::create_event | ( | THD * | thd, |
const Schema & | schema, | ||
const String_type & | event_name, | ||
const String_type & | event_body, | ||
const String_type & | event_body_utf8, | ||
const LEX_USER * | definer, | ||
Event_parse_data * | event_data | ||
) |
Create an event object and commit it to DD Table Events.
thd | Thread handle |
schema | Schema object. |
event_name | Event name |
event_body | Event body. |
event_body_utf8 | Event body in utf8 format. |
definer | Definer of the event. |
event_data | Event information obtained from parser. |
true | Event creation failed. |
false | Event creation succeeded. |
bool dd::create_native_table | ( | THD * | thd, |
const Plugin_table * | pt | ||
) |
Create plugin native table.
The API would only write metadata to DD and skip calling handler::create().
[in] | thd | THD to which lock belongs to. |
[in] | pt | Plugin_table* contain metadata of table to be created. |
Create a instance of data dictionary object of type X.
E.g., X could be 'dd::Table', 'dd::View' and etc.
template Charset_impl * dd::create_object< Charset_impl > | ( | ) |
template Collation * dd::create_object< Collation > | ( | ) |
template Collation_impl * dd::create_object< Collation_impl > | ( | ) |
template Column * dd::create_object< Column > | ( | ) |
template Column_statistics * dd::create_object< Column_statistics > | ( | ) |
template Column_type_element * dd::create_object< Column_type_element > | ( | ) |
template Event * dd::create_object< Event > | ( | ) |
template Foreign_key * dd::create_object< Foreign_key > | ( | ) |
template Foreign_key_element * dd::create_object< Foreign_key_element > | ( | ) |
template Function * dd::create_object< Function > | ( | ) |
template Index * dd::create_object< Index > | ( | ) |
template Index_element * dd::create_object< Index_element > | ( | ) |
template Index_stat * dd::create_object< Index_stat > | ( | ) |
template Partition * dd::create_object< Partition > | ( | ) |
template Partition_index * dd::create_object< Partition_index > | ( | ) |
template Partition_value * dd::create_object< Partition_value > | ( | ) |
template Procedure * dd::create_object< Procedure > | ( | ) |
template Resource_group * dd::create_object< Resource_group > | ( | ) |
template Schema * dd::create_object< Schema > | ( | ) |
template Spatial_reference_system * dd::create_object< Spatial_reference_system > | ( | ) |
template Table * dd::create_object< Table > | ( | ) |
template Table_stat * dd::create_object< Table_stat > | ( | ) |
template Tablespace * dd::create_object< Tablespace > | ( | ) |
template Tablespace_file * dd::create_object< Tablespace_file > | ( | ) |
template View * dd::create_object< View > | ( | ) |
bool dd::create_resource_group | ( | THD * | thd, |
const resourcegroups::Resource_group & | res_grp_ref | ||
) |
Create a DD object and persist it to DD table resourcegroup.
thd | Thread handle. |
res_grp_ref | Reference to resource group. |
true | Resource group creation failed. |
false | Resource group creation succeeded. |
bool dd::create_routine | ( | THD * | thd, |
const Schema & | schema, | ||
sp_head * | sp, | ||
const LEX_USER * | definer | ||
) |
Prepares dd:Routine object from sp_head and updates DD tables accordingly.
[in] | thd | Thread handle. |
[in] | schema | Schema to create the routine in. |
[in] | sp | Stored routine object to store. |
[in] | definer | Stored routine definer. |
false | ON SUCCESS |
true | ON FAILURE |
bool dd::create_schema | ( | THD * | thd, |
const char * | schema_name, | ||
const CHARSET_INFO * | charset_info, | ||
bool | default_encryption | ||
) |
Create a schema record into dd.schemata.
std::unique_ptr< dd::Table > dd::create_table | ( | THD * | thd, |
const dd::Schema & | sch_obj, | ||
const dd::String_type & | table_name, | ||
HA_CREATE_INFO * | create_info, | ||
const List< Create_field > & | create_fields, | ||
const KEY * | keyinfo, | ||
uint | keys, | ||
Alter_info::enum_enable_or_disable | keys_onoff, | ||
const FOREIGN_KEY * | fk_keyinfo, | ||
uint | fk_keys, | ||
const Sql_check_constraint_spec_list * | check_cons_spec, | ||
handler * | file | ||
) |
Prepares a dd::Table object from mysql_prepare_create_table() output and return it to the caller.
thd | Thread handle |
sch_obj | Schema. |
table_name | Table name. |
create_info | HA_CREATE_INFO describing the table to be created. |
create_fields | List of fields for the table. |
keyinfo | Array with descriptions of keys for the table. |
keys | Number of keys. |
keys_onoff | Enable or disable keys. |
fk_keyinfo | Array with descriptions of foreign keys for the table. |
fk_keys | Number of foreign keys. |
check_cons_spec | Specification of check constraints for the table. |
file | handler instance for the table. |
bool dd::create_tables | ( | THD * | thd, |
const std::set< String_type > * | create_set | ||
) |
Execute SQL statements to create the DD tables.
The tables created here will be a subset of the target DD tables for this DD version. This function is called in the following four cases:
thd | Thread context. |
create_set | Subset of the target tables which should be created during upgrade. |
std::unique_ptr< dd::Table > dd::create_tmp_table | ( | THD * | thd, |
const dd::Schema & | sch_obj, | ||
const dd::String_type & | table_name, | ||
HA_CREATE_INFO * | create_info, | ||
const List< Create_field > & | create_fields, | ||
const KEY * | keyinfo, | ||
uint | keys, | ||
Alter_info::enum_enable_or_disable | keys_onoff, | ||
const Sql_check_constraint_spec_list * | check_cons_spec, | ||
handler * | file | ||
) |
Prepares a dd::Table object for a temporary table from mysql_prepare_create_table() output.
Doesn't update DD tables, instead returns dd::Table object to caller.
thd | Thread handle. |
sch_obj | Schema. |
table_name | Table name. |
create_info | HA_CREATE_INFO describing the table to be created. |
create_fields | List of fields for the table. |
keyinfo | Array with descriptions of keys for the table. |
keys | Number of keys. |
keys_onoff | Enable or disable keys. |
check_cons_spec | Specification of check constraints for the table. |
file | handler instance for the table. |
bool dd::create_trigger | ( | THD * | thd, |
const ::Trigger * | new_trigger, | ||
enum_trigger_order_type | ordering_clause, | ||
const LEX_CSTRING & | referenced_trigger_name | ||
) |
Create new trigger in the data dictionary.
[in] | thd | thread handle |
[in] | new_trigger | Trigger object from sql-layer that describes a trigger to add in the Data Dictionary |
[in] | ordering_clause | Ordering property for trigger being created |
[in] | referenced_trigger_name | Information about trigger referenced by ordering_clause if any. |
true | Failure |
false | Success |
bool dd::create_view | ( | THD * | thd, |
const dd::Schema & | schema, | ||
Table_ref * | view | ||
) |
Store view metadata in the data-dictionary.
thd | Thread handle. |
schema | Schema where the view should be created. |
view | Table_ref element describing the view. |
false | On Success. |
true | On Failure. |
|
static |
|
static |
|
static |
Convert old row type value to corresponding value in new row format enum used by DD framework.
|
static |
|
static |
For enum in dd::View.
|
static |
|
static |
|
static |
|
static |
bool dd::drop_native_table | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name | ||
) |
Remove plugin native table from DD.
The API would only update metadata to DD and skip calling handler::drop().
[in] | thd | THD to which lock belongs to. |
[in] | schema_name | schema name which the table belongs to. |
[in] | table_name | table name to be dropped. |
bool dd::drop_resource_group | ( | THD * | thd, |
const String_type | resource_grp_name | ||
) |
Drop a resource group from DD table resourcegroup.
thd | Thread handle. |
resource_grp_name | Name of resource group to be dropped. |
true | if resource group drop failed. |
false | if resource group drop succeeded. |
bool dd::drop_table | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | name, | ||
const dd::Table & | table_def | ||
) |
bool dd::eat_pairs | ( | String_type::const_iterator & | it, |
String_type::const_iterator | end, | ||
dd::Properties * | props | ||
) |
Start at it, find a key and value separated by an unescaped '='.
Value is supposed to be terminated by an unescaped ';' or by the end of the string. Unescape the key and value and add them to the property object. Call recursively to find the remaining pairs.
[in,out] | props | property object where key and value should be added |
[in,out] | it | string iterator |
end | iterator pointing to string end |
true | if an error occurred |
false | if success |
bool dd::eat_str | ( | String_type & | dest, |
String_type::const_iterator & | it, | ||
String_type::const_iterator | end, | ||
char | c | ||
) |
Start at it, find first unescaped occorrence of c, create destination string and copy substring to destination.
Unescape the destination string, advance the iterator to get to the next character after c, or to end of string.
In the event of success, the iterator will be at the next character after the one that was to be searched for, or at the end of the string.
[out] | dest | destination string |
[in,out] | it | string iterator |
end | iterator pointing to string end | |
c | character to search for |
true | if an error occurred |
false | if success |
bool dd::eat_to | ( | String_type::const_iterator & | it, |
String_type::const_iterator | end, | ||
char | c | ||
) |
Start at it, iterate until we hit an unescaped c or the end of the string.
The stop character c may be ';' or '='. The escape character is '\'. Escapable characters are '\', '=' and ';'. Hitting an unescaped '=' while searching for ';' is an error, and also the opposite. Hitting end of string while searching for '=' is an error, but end of string while searching for ';' is ok.
In the event of success, the iterator will be at the character to be searched for, or at the end of the string.
[in,out] | it | string iterator |
end | iterator pointing to string end | |
c | character to search for |
true | if an error occurred |
false | if success |
bool dd::end_transaction | ( | THD * | thd, |
bool | error | ||
) |
Helper function to do rollback or commit, depending on error.
Also closes tables and releases transactional locks, regardless of error.
thd | Thread |
error | If true, the transaction will be rolledback. otherwise, it is committed. |
|
static |
Check if the storage engine supports geographic geometry columns.
If not, check that the columns defined only has Cartesian coordinate systems (projected SRS or SRID 0).
thd | Thread handle |
table | The table definition |
handler | Handler to the storage engine |
void dd::escape | ( | String_type * | dst, |
const String_type & | src | ||
) |
Escaping of a String_type.
Escapable characters are '\', '=' and ';'. Escape character is '\'. Iterate over all characters of src, precede all escapable characters by the escape character and append to dst. The source string is not modified.
[out] | dst | string to which escaped result will be appended. |
[in] | src | source string for escaping |
bool dd::execute_query | ( | THD * | thd, |
const dd::String_type & | q_buf | ||
) |
Create a lex string for the query from the string supplied and execute the query.
thd | Thread handle. |
q_buf | String containing the query text. |
false | Success. |
true | Error. |
bool dd::fetch_tablespace_table_refs | ( | THD * | thd, |
const Tablespace & | tso, | ||
Tablespace_table_ref_vec * | tblrefs | ||
) |
Fetch (by inserting into tblref vector) Tablespace_table_ref objects which describe tables in a given tablespace.
thd | thread context |
tso | dd object |
tblrefs | [OUT] Tablespace_table_ref objects for tables in tablespace |
true | if error occurred |
false | otherwise |
bool dd::fill_dd_check_constraints | ( | THD * | thd, |
dd::Table * | tab_obj, | ||
const Sql_check_constraint_spec_list * | check_cons_spec | ||
) |
Fill in check constraints metadata to the Table object from the list of check constraint specifications.
[in] | thd | Thread handle. |
[in,out] | tab_obj | Table object where to store the info. |
[in] | check_cons_spec | Check constraints specification list. |
bool dd::fill_dd_columns_from_create_fields | ( | THD * | thd, |
Abstract_table * | tab_obj, | ||
const List< Create_field > & | create_fields, | ||
handler * | file | ||
) |
Add column objects to dd::Abstract_table according to list of Create_field objects.
Add column objects to dd::Abstract_table objects according to the list of Create_field objects.
thd | Thread handle. |
tab_obj | dd::Table or dd::View's instance. |
create_fields | List of Create_field objects to fill dd::Column object(s). |
file | handler instance for the table. |
false | On Success |
true | On error. |
Storing default value specified for column in columns.default_value_utf8. The values are stored in string form here. This information is mostly used by the I_S queries. For others, default value can be obtained from the columns.default_values.
So now column.default_value_utf8 is not just used for storing "CURRENT_TIMESTAMP" for timestamp columns but also used to hold the default value of column of all types.
To get the default value in string form, buffer "buf" prepared in prepare_default_value() is used.
|
static |
Add foreign keys to dd::Table according to Foreign_key_spec structs.
tab_obj | table to add foreign keys to |
key_count | number of foreign keys |
keyinfo | array containing foreign key info |
Helper method for create_routine() to fill return type information of stored routine from the sp_head.
from the sp_head.
[in] | thd | Thread handle. |
[in] | sp | Stored routine object. |
[out] | sf | dd::Function object. |
|
static |
Add dd::Index_element objects to dd::Index/Table according to KEY_PART_INFO array for the index.
|
static |
Add index objects to dd::Table according to array of KEY structures.
Currently the index order type is not persisted in new DD or in .FRM. In I_S with new DD index order is calculated from the index type. That is, the index order is always calculated as ascending except for FULLTEXT and HASH index. Type of index ordering(ASC/DESC/UNDEF) is property of handler and index type. With the proper handler and the index type, index order type can be easily retrieved. So here using keyinfo with table share of handler to get the index order type. If table share does not exist for handler then dummy_table_share is created. Index order type value is stored in the index_column_usage.index_order.
Note: The keyinfo prepared here is some what different from one prepared at table opening time. For example: actual_flags, unused_key_parts, usable_key_parts, rec_per_key, rec_per_key_float ... member of keyinfo might be different in one prepared at table opening time.
But index_flags() implementations mostly uses algorithm and flags members of keyinfo to get the flag value. Apparently these members are not different from the one prepared at table opening time. So approach to get index order type from keyinfo works fine.
Alternative approach: Introduce a new handler API to get index order type using the index type. Usage of dummy_table_share and backup variables to reset handler's table share can be avoided with this approach.
TODO:Refine approach during the complete WL6599 review by dlenev.
|
static |
Fill in partitioning meta data form create_info to the table object.
[in] | thd | Thread handle. |
[in,out] | tab_obj | Table object where to store the info. |
[in] | create_info | Create info. |
[in] | create_fields | List of fields in the new table. |
[in] | part_info | Partition info object. |
|
static |
Helper method for create_routine() to prepare dd::Routine object from the sp_head.
[in] | thd | Thread handle. |
[in] | schema | Schema where the routine is to be created. |
[in] | sp | Stored routine object. |
[in] | definer | Definer of the routine. |
[out] | routine | dd::Routine object to be prepared from the sp_head. |
false | ON SUCCESS |
true | ON FAILURE |
|
static |
Fill dd::Table object from mysql_prepare_create_table() output.
|
static |
Set dd::Tablespace object id for dd::Table and dd::Partition object during CREATE TABLE.
thd | - Thread handle. |
obj | - dd::Table or dd::Partition. |
hton | - handlerton of table or a partition. |
tablespace_name | - Tablespace name to be associated with Table or partition. |
is_temporary_table | - Is this temporary table ? |
Method to fill view columns from the first Query_block of view query.
thd | Thread Handle. |
view_obj | DD view object. |
view | Table_ref object of view. |
false | On Success. |
true | On failure. |
Method to fill view information in the View object.
thd | Thread handle. |
view_obj | DD view object. |
view | View description. |
false | On success. |
true | On failure. |
|
static |
Method to fill view routines from the set of routines used by view query.
view_obj | DD view object. |
routines_ctx | Query_table_list object for the view which contains set of routines used by view query. |
|
static |
Method to fill base table and view names used by view query in DD View object.
view_obj | DD view object. |
view | Table_ref object of view. |
query_tables | View query tables list. |
|
static |
Fill in a dd::Trigger object based on a Trigger object supplied by sql-layer.
[in] | new_trigger | Trigger object supplied by sql-layer |
[out] | dd_trig_obj | dd::Trigger object to fill in |
true | Failure |
false | Success |
|
static |
Helper method for create_routine() to fill parameter information from the object of type Create_field.
Method is called by the fill_routine_parameters_info().
[in] | thd | Thread handle. |
[in] | field | Object of type Create_field. |
[out] | param | Parameter object to be filled using the state of field object. |
Helper method for create_routine() to fill parameters of routine to dd::Routine object from the sp_head.
Method is called from the fill_dd_routine_info().
[in] | thd | Thread handle. |
[in] | sp | Stored routine object. |
[out] | routine | dd::Routine object prepared from sp_head. |
false | ON SUCCESS |
true | ON FAILURE |
bool dd::fill_table_and_parts_tablespace_names | ( | THD * | thd, |
const char * | db_name, | ||
const char * | table_name, | ||
Tablespace_hash_set * | tablespace_set | ||
) |
Fill Tablespace_hash_set with tablespace names used by the given db_name.table_name.
thd | - Thread invoking the function. |
db_name | - Database name. |
table_name | - Table name. |
tablespace_set | - (OUT) hash set where tablespace names are filled. |
Update row format for the table with the value value supplied by caller function.
[in] | thd | Thread context. |
[in] | table | Table object for the table. |
[in] | correct_row_type | row_type to be set. |
false | Success |
true | Error |
bool dd::generic_lookup_ref | ( | THD * | thd, |
MDL_key::enum_mdl_namespace | mdlns, | ||
const String_type & | name, | ||
dd::Object_id * | idp | ||
) |
String_type dd::generic_serialize | ( | THD * | thd, |
const char * | dd_object_type, | ||
size_t | dd_object_type_size, | ||
const T & | dd_obj, | ||
const String_type * | schema_name | ||
) |
void dd::generic_track_object | ( | dd_vector< T * > * | tvp, |
T * | t | ||
) |
Column * dd::get_by_opx | ( | Sdi_rcontext * | rctx, |
const Column * | , | ||
uint | opx | ||
) |
Return an non-owning raw pointer to the deserialized Column object with ordinal position index opx (ordinal position opx+1).
The unused const Column* argument is needed for overload resolution.
rctx | opaque context |
opx | ordinal position index |
Index * dd::get_by_opx | ( | Sdi_rcontext * | rctx, |
const Index * | , | ||
uint | opx | ||
) |
Return an non-owning raw pointer to the deserialized Index object with ordinal position index opx (ordinal position opx+1).
The unused const Index* argument is needed for overload resolution.
rctx | opaque context |
opx | ordinal position index |
|
inlinestatic |
Get DD API value of action timing for a trigger.
[in] | new_trigger | pointer to a Trigger object from sql-layer. |
cache::Dictionary_client * dd::get_dd_client | ( | THD * | thd | ) |
Get Dictionary_client from THD object (the latter is opaque * in SEs).
|
inlinestatic |
Get DD API value of event type for a trigger.
[in] | new_trigger | pointer to a Trigger object from sql-layer. |
const Object_table & dd::get_dd_table | ( | ) |
Get the Object_table instance storing the given entity object type.
We can return this as a reference since all relevant types for which this template is used will indeed have a corresponding object table.
Entity_object_type | Type for which to get the object table. |
template const Object_table & dd::get_dd_table< dd::Column > | ( | ) |
template const Object_table & dd::get_dd_table< dd::Index > | ( | ) |
template const Object_table & dd::get_dd_table< dd::Partition > | ( | ) |
template const Object_table & dd::get_dd_table< dd::Table > | ( | ) |
template const Object_table & dd::get_dd_table< dd::Tablespace > | ( | ) |
Dictionary * dd::get_dictionary | ( | ) |
Get the data dictionary instance.
|
static |
Convert legacy event status to dd::Event::enum_event_status.
event_status | Legacy event_status |
|
static |
Convert legacy interval type value to dd::Event::enum_interval_field.
interval_type_val | Interval type value. |
bool dd::get_field_datetime_precision | ( | const Create_field * | field, |
uint * | datetime_precision | ||
) |
Helper method to get datetime precision for types using Create_field type object.
[in] | field | Field object. |
[out] | datetime_precision | datetime precision value for types. |
false | If datetime precision is calculated. |
true | If datetime precision is not calculated; |
|
static |
Get a string of fields to be stores as partition_expression.
Must be in sync with set_field_list()!
[in,out] | str | String to add the field name list to. |
[in] | name_list | Field name list. |
bool dd::get_field_numeric_precision | ( | const Create_field * | field, |
uint * | numeric_precision | ||
) |
Helper method to get numeric precision for types using Create_field type object.
[in] | field | Field object. |
[out] | numeric_precision | numeric precision value for types. |
false | If numeric precision is calculated. |
true | If numeric precision is not calculated; |
bool dd::get_field_numeric_scale | ( | const Create_field * | field, |
uint * | scale | ||
) |
Helper method to get numeric scale for types using Create_field type object.
[in] | field | Field object. |
[out] | scale | numeric scale value for types. |
false | If numeric scale is calculated. |
true | If numeric scale is not calculated; |
|
static |
Translate from the old fk_option enum to the new dd::Foreign_key::enum_rule enum.
opt | old fk_option enum. |
bool dd::get_implicit_tablespace_options | ( | THD * | thd, |
const Table * | table, | ||
ulonglong * | autoextend_size | ||
) |
Get the autoextend_size option value for implicit tablespaces.
thd | Thread handler |
table | dd::Table instance |
autoextend_size | Value of autoextend_size attribute |
enum_column_types dd::get_new_field_type | ( | enum_field_types | type | ) |
Convert to and from new enum types in DD framework to current MySQL server enum types.
Convert field type from MySQL server type to new enum types in DD.
We have plans to retain both old and new enum values in DD tables so as to handle client compatibility and information schema requirements.
We have plans to retain both old and new enum values in DD tables so as to handle client compatibility and information schema requirements.
[in] | type | MySQL server field type. |
field | type used by DD framework. |
interval_type dd::get_old_interval_type | ( | Event::enum_interval_field | interval_field | ) |
Convert new DD interval_field type to type interval_type used in server code.
interval_field | interval_field of type enum_interval_field. |
int dd::get_old_on_completion | ( | Event::enum_on_completion | on_completion | ) |
Convert new DD Event::enum_on_completion to completion type used in server code.
on_completion | on_completion of type enum_on_completion. |
int dd::get_old_status | ( | Event::enum_event_status | event_status | ) |
Convert new DD Event::enum_event_status to status type used in server code.
event_status | status of type enum_event_status. |
|
static |
Convert legacy event on completion behavior to dd::Event::enum_on_compeltion.
on_completion | Legacy on completion behaviour value |
Get the SE private data from the dd_properties table.
[in] | thd | Thread context. |
[in,out] | tab_obj | Table object to which SE private data should be added. |
dd::String_type dd::get_sql_type_by_create_field | ( | TABLE * | table, |
const Create_field & | field | ||
) |
Function returns string representing column type by Create_field.
This is required for the IS implementation which uses views on DD
This is required for the IS implementation which uses views on DD tables
[in] | table | TABLE object. |
[in] | field | Column information. |
String_type dd::get_sql_type_by_field_info | ( | THD * | thd, |
enum_field_types | field_type, | ||
uint32 | field_length, | ||
uint32 | decimals, | ||
bool | maybe_null, | ||
bool | is_unsigned, | ||
const CHARSET_INFO * | field_charset | ||
) |
Function returns string representing column type by ST_FIELD_INFO.
Function prepares string representing columns data type.
This is required for the IS implementation which uses views on DD tables
[in] | thd | The thread handle. |
[in] | field_type | Column type. |
[in] | field_length | Column length. |
[in] | decimals | Decimals. |
[in] | maybe_null | Column is null. |
[in] | is_unsigned | Column is unsigned. |
[in] | field_charset | Column charset. |
This is required for IS implementation which uses views on DD tables
bool dd::get_tablespace_name | ( | THD * | thd, |
const T * | obj, | ||
const char ** | tablespace_name, | ||
MEM_ROOT * | mem_root | ||
) |
Read tablespace name of a tablespace_id.
thd | - Thread invoking this call. |
obj | - Table/Partition object whose tablespace name is being read. |
tablespace_name | (OUT) - Tablespace name of table. |
mem_root | - Memroot where tablespace name should be stored. |
bool dd::get_tablespace_name | ( | THD * | thd, |
const T * | obj, | ||
String_type * | name | ||
) |
Read tablespace name of a tablespace_id from Table or similar object.
thd | Thread invoking this call. | |
obj | Table/Partition/Index/.. object whose tablespace name is being read. | |
[out] | name | Tablespace name. |
bool dd::getprop | ( | THD * | thd, |
const char * | key, | ||
String_type * | value, | ||
bool | silent = false |
||
) |
bool dd::has_exclusive_table_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name | ||
) |
Predicate to check if we have an exclusive meta data lock on the submitted schema qualified table name.
thd | Thread context. |
schema_name | Schema name. |
table_name | Table name. |
true | The thread context has a lock. |
false | The thread context does not have a lock. |
bool dd::has_exclusive_tablespace_mdl | ( | THD * | thd, |
const char * | tablespace_name | ||
) |
Predicate to check if we have an exclusive meta data lock on the submitted tablespace name.
thd | Thread context. |
tablespace_name | Tablespace name. |
true | The thread context has a lock. |
false | The thread context does not have a lock. |
bool dd::has_primary_key | ( | const Table & | t | ) |
Predicate which indicates if the table has real (non-hidden) primary key.
t | table to check |
bool dd::has_shared_table_mdl | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name | ||
) |
Predicate to check if we have a shared meta data lock on the submitted schema qualified table name.
thd | Thread context. |
schema_name | Schema name. |
table_name | Table name. |
true | The thread context has a lock. |
false | The thread context does not have a lock. |
bool dd::has_shared_tablespace_mdl | ( | THD * | thd, |
const char * | tablespace_name | ||
) |
Predicate to check if we have a shared meta data lock on the submitted tablespace name.
thd | Thread context. |
tablespace_name | Tablespace name. |
true | The thread context has a lock. |
false | The thread context does not have a lock. |
bool dd::init | ( | enum_dd_init_type | dd_init | ) |
Initialize data dictionary upon server startup, server startup on old data directory or install data dictionary for the first time.
dd_init | - Option for initialization, population or deletion of data dictionary. |
bool dd::initialize_dd_properties | ( | THD * | thd | ) |
During –initialize, we create the dd_properties table.
During restart, create its meta data, and use it to open and read its contents.
thd | Thread context. |
bool dd::invalid_tablespace_usage | ( | THD * | thd, |
const dd::String_type & | schema_name, | ||
const dd::String_type & | table_name, | ||
const HA_CREATE_INFO * | create_info | ||
) |
Checking if the table is being created in a restricted tablespace.
thd | Thread context. |
schema_name | Name of the schema where the table is located. |
table_name | Name of the table. |
create_info | Table options, e.g. the tablespace name. |
true | Invalid usage (error has been reported). |
false | Success, no invalid usage. |
|
static |
|
inline |
|
inline |
|
inline |
|
static |
bool dd::is_general_tablespace_and_encrypted | ( | const KEY | k, |
THD * | thd, | ||
bool * | is_encrypted_tablespace, | ||
bool * | is_general_tablespace | ||
) |
bool dd::is_generated_check_constraint_name | ( | const char * | table_name, |
size_t | table_name_length, | ||
const char * | cc_name, | ||
size_t | cc_name_length | ||
) |
Check if name of check constraint is generated one.
table_name | Table name. |
table_name_length | Table name length. |
cc_name | Check constraint name. |
cc_name_length | Check constraint name length. |
true | If check constraint name is generated one. |
false | Otherwise. |
bool dd::is_generated_foreign_key_name | ( | const char * | table_name, |
size_t | table_name_length, | ||
handlerton * | hton, | ||
const dd::Foreign_key & | fk | ||
) |
Check if foreign key name is generated one.
table_name | Table name. |
table_name_length | Table name length. |
hton | Table storage engine. |
fk | Foreign key to be checked. |
bool dd::is_non_inert_dd_or_ddse_table | ( | System_tables::Types | table_type | ) |
Predicate to check if a table type is a non-inert DD or a DDSE table.
table_type | Type as defined in the System_tables registry. |
bool dd::is_server_ps_table_name | ( | const dd::String_type & | schema_name, |
const dd::String_type & | table_name | ||
) |
bool dd::is_string_in_lowercase | ( | const String_type & | str, |
const CHARSET_INFO * | cs | ||
) |
Method to verify if string is in lowercase.
str | String to verify. |
cs | Character set. |
true | If string is in lowercase. |
false | Otherwise. |
Encrypt_result dd::is_tablespace_encrypted | ( | THD * | thd, |
const HA_CREATE_INFO * | ci, | ||
bool * | is_general_tablespace | ||
) |
Predicate to determine if a table resides in an encrypted tablespace and if it a general tablespace.
[in] | thd | Thread |
[in] | ci | HA_CREATE_INFO * Representing table DDL. |
[out] | is_general_tablespace | Marked as true on success if its general tablespace. |
Encrypt_result dd::is_tablespace_encrypted | ( | THD * | thd, |
const Table & | t, | ||
bool * | is_general_tablespace | ||
) |
Predicate to determine if a table resides in an encrypted tablespace.
First checks if the option "encrypt_type" is set on the table itself (implicit tablespace), then proceeds to acquire and check the "ecryption" option in table's tablespaces.
[in] | thd | thread context |
[in] | t | table to check |
[out] | is_general_tablespace | Denotes if we found general tablespace. |
|
inlinestatic |
Check if the string contain characters of 0 and 1.
|
static |
bool dd::load_triggers | ( | THD * | thd, |
MEM_ROOT * | mem_root, | ||
const char * | schema_name, | ||
const char * | table_name, | ||
const dd::Table & | table, | ||
List<::Trigger > * | triggers | ||
) |
Load table triggers from the data dictionary.
[in] | thd | thread handle |
[in] | mem_root | MEM_ROOT for memory allocation |
[in] | schema_name | name of schema |
[in] | table_name | subject table name |
[in] | table | table object |
[out] | triggers | pointer to the list where new Trigger objects will be inserted |
true | Failure |
false | Success |
const String_type & dd::lookup_schema_name | ( | Sdi_wcontext * | wctx | ) |
Returns const reference to string holding schema name to use in SDI.
wctx | opaque context. |
bool dd::lookup_schema_ref | ( | Sdi_rcontext * | rctx, |
const String_type & | name, | ||
Object_id * | idp | ||
) |
Return the the Object_id of a schema name in the current data dictionary.
Used to recreate a reference to a schema during deserialization.
rctx | opaque context. |
name | schema name used as reference. |
idp | [OUT] pointer to Object_id variable where result is stored. |
const dd::String_type & dd::lookup_tablespace_name | ( | Sdi_wcontext * | wctx, |
dd::Object_id | id | ||
) |
Look up the tablespace name for a tablespace id.
Returns a reference to the name string inside an acquired tablespace object. The lifetime of these tablespace objects are managed by the Auto_releaser in the scope where the dd store is initiated.
wctx | opaque context |
id | tablespace id to look up |
bool dd::lookup_tablespace_ref | ( | Sdi_rcontext * | rctx, |
const String_type & | name, | ||
Object_id * | idp | ||
) |
Return the the Object_id of a tablespace name in the current data dictionary.
Used to recreate a reference to a tablespace during deserialization.
rctx | opaque context. |
name | schema name used as reference. |
idp | [OUT] pointer to Object_id variable where result is stored. |
String_type dd::make_string_type | ( | const LEX_STRING_TYPE & | lst | ) |
bool dd::mdl_lock_schema | ( | THD * | thd, |
const char * | schema_name, | ||
enum_mdl_duration | duration, | ||
MDL_ticket ** | ticket = nullptr |
||
) |
Acquire MDL on schema name.
thd | Thread context. |
schema_name | Schema to check for. |
duration | Duration type for MDL |
ticket | Where to store ticket pointer (default: nullptr, no ticket pointer will be stored) |
MDL_request * dd::mdl_req | ( | THD * | thd, |
const Tablespace_table_ref & | tref, | ||
enum enum_mdl_type | mdl_type | ||
) |
Create am MDL_request for a the table identified by a Tablespace_table_ref.
thd | thread context |
tref | table to create request for |
mdl_type | The lock type requested. |
MDL_request | (allocated on thd->memroot) |
MDL_request * dd::mdl_schema_req | ( | THD * | thd, |
const dd::String_type & | schema_name | ||
) |
Create am MDL_request for a the schema name provided.
thd | thread context |
schema_name | on which to create request for |
MDL_request | (allocated on thd->memroot) |
Convert seconds since epoch, to a datetime ulonglong using my_tz_OFFSET0 suitable for timestamp fields in the DD.
seconds_since_epoch | value to convert |
size_t dd::normalize_string | ( | const CHARSET_INFO * | cs, |
const String_type & | src, | ||
char * | normalized_str_buf, | ||
size_t | normalized_str_buf_length | ||
) |
Normalize (or transform) the multibyte character set string.
The normalized string contains the weight of the each character of the source string. The normalized strings are suitable for the comparisons (strings yields the correct collation order).
cs | Character set. | |
src | Source string. | |
[out] | normalized_str_buf | Buffer to store the normalized string. |
normalized_str_buf_length | Size of the normalized_str_buf. |
|
static |
bool dd::operator< | ( | const Tablespace_table_ref & | a, |
const Tablespace_table_ref & | b | ||
) |
bool dd::operator== | ( | const Tablespace_table_ref & | a, |
const Tablespace_table_ref & | b | ||
) |
Properties * dd::parse_properties | ( | const String_type & | str | ) |
Factory function for creating a Property object from String_type.
str | string representation of properties |
|
static |
Helper method to get default value of column in the string format.
The default value prepared from this methods is stored in the columns.default_value_utf8. This information is mostly used by the I_S queries only. For others, default value can be obtained from the columns.default_values.
[in] | buf | Default value buffer. |
[in] | table | Table object. |
[in] | field | Field information. |
[in] | col_obj | DD column object for the field. |
[out] | def_value | Default value is stored in the string format if non-NULL default value is specified for the column. Empty string is stored if no default value is specified for the column. def_value is not set if default value for the column is nullptr. |
Read view metadata from dd.views into Table_ref.
bool dd::recreate_table | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name | ||
) |
Regenerate a metadata locked table.
This function does not set error codes beyond what is set by the functions it calls.
[in] | thd | Thread context |
[in] | schema_name | Name of the schema |
[in] | table_name | Name of the table |
false | Success |
true | Error |
void dd::release_mdl | ( | THD * | thd, |
MDL_ticket * | mdl_ticket | ||
) |
Release MDL_EXPLICIT lock held by a ticket.
thd | - THD to which lock belongs to. |
mdl_ticket | - Lock ticket. |
bool dd::rename_check_constraints | ( | const char * | old_table_name, |
dd::Table * | new_tab | ||
) |
Rename generated check constraint names to match the new name of the table.
old_table_name | Table name before rename. |
new_tab | New version of the table with new name set. |
bool dd::rename_foreign_keys | ( | THD * | thd, |
const char * | old_db, | ||
const char * | old_table_name, | ||
handlerton * | hton, | ||
const char * | new_db, | ||
dd::Table * | new_tab | ||
) |
Rename foreign keys which have generated names to match the new name of the table.
thd | Thread context. |
old_db | Table's database before rename. |
old_table_name | Table name before rename. |
hton | Table's storage engine. |
new_db | Table's database after rename. |
new_tab | New version of the table with new name set. |
void dd::rename_tablespace_mdl_hook | ( | THD * | thd, |
MDL_ticket * | src, | ||
MDL_ticket * | dst | ||
) |
Implicit tablespaces are renamed inside SE.
But it is necessary to inform the server layer about the rename, specifically which MDLs have been taken, so that it can perform the necessary adjustment of MDLs when running in LOCK TABLES mode.
thd | thread context |
src | ticket for old name |
dst | ticket for new name |
|
inline |
|
inline |
bool dd::reset_tables_and_tablespaces | ( | ) |
Reset the tables and tablespace partitions in the DD cache, and invalidate the entries in the DDSE cache.
bool dd::resource_group_exists | ( | dd::cache::Dictionary_client * | dd_client, |
const String_type & | resource_group_name, | ||
bool * | exists | ||
) |
Check if resource group exists in the data dictionary.
dd_client | Dictionary client. | |
resource_group_name | Name of the resource group. | |
[out] | exists | Value set to true if DD object found else false. |
true | Failure (error has been reported). |
false | Success. |
bool dd::schema_exists | ( | THD * | thd, |
const char * | schema_name, | ||
bool * | exists | ||
) |
Check if given schema exists.
thd | Thread context. | |
schema_name | Schema to check for. | |
[out] | exists | true if schema exists, else false. |
|
static |
Set Event attributes.
thd | THD context. |
schema | Schema containing the event. |
event | Pointer to Event Object. |
event_name | Event name. |
event_body | Event body. |
event_body_utf8 | Event body utf8. |
definer | Definer of event. |
event_data | Parsed Event Data. |
is_update | true if existing Event objects attributes set else false. |
|
static |
Helper function to set partition options.
|
static |
bool dd::setprop | ( | THD * | thd, |
const char * | key, | ||
const String_type & | value, | ||
bool | silent = false |
||
) |
bool dd::shutdown | ( | ) |
Shuts down the data dictionary instance by deleting the instance of dd::Dictionary_impl* upon server shutdown.
void dd::store_predefined_tablespace_metadata | ( | THD * | thd | ) |
This function creates the meta data of the predefined tablespaces.
thd | Thread context. |
bool dd::sync_meta_data | ( | THD * | thd | ) |
Acquire the DD schema, tablespace and table objects.
Read the persisted objects from the DD tables, and replace the contents of the core registry in the storage adapter
thd | Thread context. |
bool dd::table_exists | ( | dd::cache::Dictionary_client * | client, |
const char * | schema_name, | ||
const char * | name, | ||
bool * | exists | ||
) |
Check if a table or view exists.
table_exists() sets exists=true if such a table or a view exists.
client | The dictionary client. | |
schema_name | The schema in which the object should be defined. | |
name | The object name to search for. | |
[out] | exists | A boolean which is set to true if the object is found. |
true | Failure (error has been reported). |
false | Success. |
bool dd::table_has_triggers | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name, | ||
bool * | table_has_trigger | ||
) |
Check in the data dictionary if there is any trigger associated with a table.
[in] | thd | thread handle |
[in] | schema_name | name of schema |
[in] | table_name | subject table name |
[out] | table_has_trigger | true in case there is trigger(s) for a table, else false |
true | Failure |
false | Success |
bool dd::table_legacy_db_type | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | table_name, | ||
enum legacy_db_type * | db_type | ||
) |
Get the legacy db type from the options of the given table.
This function does not set error codes beyond what is set by the functions it calls.
[in] | thd | Thread context |
[in] | schema_name | Name of the schema |
[in] | table_name | Name of the table |
[out] | db_type | Value of the legacy db type option |
true | Error, e.g. name is not a table, or no legacy_db_type in the table's options. In this case, the value of db_type is undefined. |
false | Success |
bool dd::table_storage_engine | ( | THD * | thd, |
const T * | obj, | ||
handlerton ** | hton | ||
) |
Get the storage engine handlerton for the given table or tablespace.
This function sets explicit error codes if:
[in] | thd | Thread context |
[in] | obj | dd::Table or a dd::Tablespace object. |
[out] | hton | Handlerton for the table's storage engine |
true | Error |
false | Success |
template bool dd::table_storage_engine< dd::Table > | ( | THD * | , |
const dd::Table * | , | ||
handlerton ** | |||
) |
template bool dd::table_storage_engine< dd::Tablespace > | ( | THD * | , |
const dd::Tablespace * | , | ||
handlerton ** | |||
) |
void dd::track_object | ( | Sdi_rcontext * | rctx, |
Column * | column_object | ||
) |
Register Column objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.
rctx | opaque context |
column_object | object which may be referenced by other objects. |
void dd::track_object | ( | Sdi_rcontext * | rctx, |
Index * | index_object | ||
) |
Register Index objects being deserialized so that it will be possible to resolve references to it after deserialization has finished.
rctx | opaque context |
index_object | object which may be referenced by other objects. |
bool dd::unescape | ( | String_type & | dest | ) |
In place unescaping of String_type.
Escapable characters are '\', '=' and ';'. Escape character is '\'. Iterate over all characters, remove escape character if it precedes an escapable character.
[in,out] | dest | source and destination string for escaping |
true | if an escapable character is not escaped |
false | if success |
bool dd::update_event | ( | THD * | thd, |
Event * | event, | ||
const dd::Schema & | schema, | ||
const dd::Schema * | new_schema, | ||
const String_type & | new_event_name, | ||
const String_type & | new_event_body, | ||
const String_type & | new_event_body_utf8, | ||
const LEX_USER * | definer, | ||
Event_parse_data * | event_data | ||
) |
Create or update a event object and commit it to DD Table Events.
thd | Thread handle |
event | Event to update. |
schema | Schema currently containing the event. |
new_schema | New Schema or nullptr if the schema does not change. |
new_event_name | Updated Event name. |
new_event_body | Updated Event body. |
new_event_body_utf8 | Updated Event body in utf8 format. |
definer | Definer of the event. |
event_data | Event information obtained from parser. |
true | Event updation failed. |
false | Event updation succeeded. |
bool dd::update_event_time_and_status | ( | THD * | thd, |
Event * | event, | ||
my_time_t | last_executed, | ||
ulonglong | status | ||
) |
Update time related fields of Event object.
thd | Thread handle |
event | Event to update. |
last_executed | Time the event was last executed. |
status | Event status. |
true | true if update failed. |
false | false if update succeeded. |
bool dd::update_properties | ( | THD * | thd, |
const std::set< String_type > * | create_set, | ||
const std::set< String_type > * | remove_set, | ||
const String_type & | target_table_schema_name | ||
) |
Update properties in the DD_properties table.
Note that upon failure, we will rollback, whereas upon success, commit will be delayed.
thd | Thread context. |
create_set | A set of table names created/modified in this version of DD. |
remove_set | A set of table names removed in this version of DD. |
target_table_schema_name | Schema name in which the final changes are required. |
bool dd::update_resource_group | ( | THD * | thd, |
const String_type & | resource_grp_name, | ||
const resourcegroups::Resource_group & | res_grp_ref | ||
) |
Update a resource group and persist it to DD table resourcegroup.
thd | Thread handle |
resource_grp_name | Name of the resource group. |
res_grp_ref | Reference to resource group. |
true | Updating Resource group failed. |
false | Updating Resource group succeeded. |
bool dd::update_versions | ( | THD * | thd, |
bool | is_dd_upgrade_57 | ||
) |
Updates the DD Version in the DD_properties table to the current version.
This function is used during initialize and during server upgrade.
thd | Thread context. |
is_dd_upgrade_57 | Flag to indicate if it is an upgrade from 5.7. |
Update view metadata in dd.views.
thd | Thread handle. |
new_view | View object that should be updated. |
view | Table_ref element describing the new view. |
false | On success. |
true | On failure. |
bool dd::update_view_status | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | view_name, | ||
bool | status, | ||
bool | commit_dd_changes | ||
) |
Update view status(valid/invalid) value in dd.views.options.
thd | Thread handle. |
schema_name | Schema name. |
view_name | View name. |
status | View status(valid/invalid). |
commit_dd_changes | Indicates whether changes to DD need to be committed. |
false | On Success. |
true | On Failure. |
bool dd::uses_general_tablespace | ( | const Table & | t | ) |
Check if table uses general tablespace.
t | dd::Table instance. |
bool dd::visit_tablespace_id_owners | ( | const Partition & | p, |
VISITOR_TYPE && | visitor | ||
) |
Visitor function which invokes its visitor argument on any subobject which holds a tablespace, that is, the partition itself, its Partition_indexes, its sub-partitions, and Partition_indexes of those.
Visitation is terminated when the vistor closure returns true.
p | partition to visit. |
visitor | generic closure which can be applied to all tablespace holding objects. |
bool dd::visit_tablespace_id_owners | ( | const Table & | t, |
VISITOR_TYPE && | visitor | ||
) |
Visitor function which invokes its visitor argument on any subobject which holds a tablespace, that is, the table itself, its m_indexes, its m_partitions, and m_indexes (Partition_index) of each partition and sub-partition.
Visitation is terminated when the vistor closure returns true.
t | table to visit. |
visitor | generic closure which can be applied to all tablespace holding objects. |
void dd::warn_on_deprecated_prefix_key_partition | ( | THD * | thd, |
const char * | schema_name, | ||
const char * | orig_table_name, | ||
const Table * | table, | ||
const bool | is_upgrade | ||
) |
Throw deprecation warnings if table uses prefix keys in the partitioning function.
thd | Thread handler |
schema_name | Schema name |
orig_table_name | Original table name (required in case of ALTER TABLE, since temporary table name is created) |
table | dd::Table instance |
is_upgrade | True if this is called during upgrade. Warning will be sent to error log instead of the client. |
|
static |
|
staticconstexpr |
|
static |
|
static |
If a new DD version is published in a MRU, that version may or may not be possible to downgrade to previous MRUs within the same GA.
From a technical perspective, we may support downgrade for some types of changes to the DD tables, such as:
i) Addition of new attributes to a predefined general purpose option-like field. ii) Addition of a column at the end of the table definition. iii) Addition of elements at the end of an enumeration column type. iv) Extension of a VARCHAR field. v) Addition of an index on a column.
This means we can support downgrade in terms of being able to open the DD tables and read from them. However, additional considerations are relevant in order to determine whether downgrade should be supported or not, e.g.:
If downgrade is supported, the constant DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be set to the lowest DD_VERSION that we may downgrade to. If downgrade is not supported at all, then DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be set to DD_VERSION.
It has been decided that the default policy for MySQL 8.0 is not to allow downgrade for any minor release. One of the major reasons for this is that this would lead to a huge amount of possible upgrade/downgrade paths with correspondingly complicated and effort demanding QA. Thus, we set this constant to be equal to DD_VERSION to prohibit downgrade attempts. This decision may be relaxed for future releases.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
The default object ID which represents that the DD object is new and not persistent in dictionary tables yet.
|
constexpr |
The version of the current SDI Json format.
This version number is stored inside SDIs. This number is bumpred only when there is a change in how the data dictionary information is converted to json (e.g. adding a forgotten member). It does not need to be bumped when the data dictionary schema structure is changed, as this is covered by the DD_VERSION variable.
The SDI version number is the MySQL server version number of the first MySQL server version that published a given SDI Json format. The format is Mmmdd with M=Major, m=minor, d=dot, so that MySQL 8.0.4 is encoded as 80004. This is the same version numbering scheme as the information schema and performance schema are using.
The next change to the SDI Json format will be associated with the next available MySQL server version number.
Historical version number published in the data dictionary, (note that 1 is a legacy number from before SDI version numbers were mapped to server versions):
Initial version.
Changes from version 1:
Changes from version 80016:
800XX: Next SDI version number after the previous is public. The next server version > current SDI version where a change to the SDI
Changes from current version:
If a new SDI version is published in a MRU, it will not be possible to import this version into previous MRUs within the same GA.
|
constexpr |
A new release model supporting Long Term Stability (LTS) and innovation releases is being introduced.
The LTS releases will be kept as stable as possible, patch updates will be provided mostly for critical issues. Innovation releases will be released regularly with new features.
When we start a new major version, e.g. 9.0.0, this is an innovation release. Each consecutive release is a new innovation release where the minor version number is incremented. The last minor version for a given major version is an LTS release, this will normally have minor version 7, e.g. 9.7.0. The LTS release will have regular CPU releases (critical patch update) where the major and minor versions stay unchanged, and only the patch number is incremented (e.g. 9.7.1, 9.7.2 etc.). In parallel with the CPU releases, a new major version will also be released, starting with an incremented major version number (e.g. 10.0.0). In some cases, the innovation releases may also have CPU releases, e.g. 9.1.0, 9.1.1 etc.
With the release model supporting LTS releases, we will have to support downgrade between patch releases. Normally, there will be no changes in features in a patch release, and the disk image should have a similar format, both in terms of record layout, data dictionary structure, system table definitions, information schema, performance schema, etc. However, there might be situations where changes that are not backwards compatible need to be made within a patch release. For some server artifacts, we already have mechanisms in place to allow older versions to reject a downgrade attempt (e.g. if the data dictionary is changed, the older version will reject the downgrade attempt). For other artifacts, there is no such mechanism. Thus, we introduce the SERVER_DOWNGRADE_THRESHOLD which makes it possible to define how far back the current version should be able to downgrade. On a downgrade attempt, the target version will look at the threshold which has been stored persistently by the actual server that we downgrade from. If the target server version is lower than the threshold, it will reject the downgrade attempt.
The threshold defaults to 0. This means that downgrade back to the first patch for the given version is possible. E.g. if LTS version 9.7.2 has the threshold defined to 0, downgrades to 9.7.1 and 9.7.0 is possible. Then, if LTS version 9.7.3 is released with the threshold set to 9.7.2, then only downgrade to 9.7.2 is possible. Downgrades to or from innovation releases are never supported, regardless of the downgrade threshold.
|
constexpr |
The new release model explained above will also open the possibility of upgrading to a version that has been released in the past.
I.e., we will upgrade from an actual version to a target version with a higher version number, but an earlier (older) GA release date.
Like for the patch downgrades mentioned above, we already have mechanisms in place to allow older versions to reject an upgrade attempt (e.g. if the data dictionary is changed, the older version will reject the upgrade attempt). For other artifacts, there is no such mechanism. Thus, we introduce the SERVER_UPGRADE_THRESHOLD which makes it possible to define how far back the current version should be able to upgrade. On an upgrade attempt, the target version will look at the threshold which has been stored persistently by the actual server that we upgrade from. If the target server version is lower than the threshold, it will reject the upgrade attempt.
The threshold defaults to 0. This means that for upgrades to any higher version is possible (unless prohibited by other rules). E.g. if LTS version 9.7.2 has the threshold defined to 0, upgrades to 10.0.0, 10.1.0 etc. is possible. Then, if LTS version 9.7.3 is released with the upgrade threshold set to 10.2.0, then upograde from 9.7.3 is possible only to 10.2.0 or higher.