MySQL 8.4.2
Source Code Documentation
|
Innodb data dictionary name. More...
Typedefs | |
using | Convert_Func = std::function< void(std::string &)> |
Name string conversion callback. More... | |
Functions | |
void | file_to_table (std::string &name, bool quiet) |
Conversion function to change for system to file name cs. More... | |
void | table_to_file (std::string &name) |
Conversion function to change for file name to system cs. More... | |
static void | get_partition_separators (bool is_57, std::string &part_sep, std::string &sub_part_sep) |
Get partition and sub-partition separator strings. More... | |
static bool | check_partition (const std::string &dict_name, bool sub_part, size_t &position) |
Check for partition and sub partition. More... | |
static bool | check_tmp (const std::string &dict_name, size_t &position) |
Check for TMP extension name. More... | |
bool | is_partition (const std::string &dict_name) |
Check if it is a table partition. More... | |
void | get_table (const std::string &dict_name, std::string &schema, std::string &table) |
Get schema and table name from dictionary table name. More... | |
void | get_table (const std::string &dict_name, bool convert, std::string &schema, std::string &table, std::string &partition, bool &is_tmp) |
Get schema, table name, partition string and temporary attribute from dictionary table name. More... | |
std::optional< table_name_components > | parse_tablespace_path (std::string path) |
Get schema, table name, partition, subpartition and absolute directory from dictionary from filepath. More... | |
void | get_partition (const std::string &partition, bool convert, std::string &part, std::string &sub_part) |
Get partition and sub-partition name from partition string. More... | |
void | build_table (const std::string &schema, const std::string &table, const std::string &partition, bool is_tmp, bool convert, std::string &dict_name) |
static void | build_partition_low (const std::string part, const std::string sub_part, Convert_Func conv, bool is_57, std::string &partition) |
Build partition string from partition and sub-partition name. More... | |
static void | get_part_from_dd (const dd::Partition *dd_part, bool lower_case, std::string &part_name, std::string &sub_name) |
Get partition and sub-partition name from DD. More... | |
void | build_partition (const dd::Partition *dd_part, std::string &partition) |
Build partition string from dd object. More... | |
void | build_57_partition (const dd::Partition *dd_part, std::string &partition) |
Build 5.7 style partition string from dd object. More... | |
bool | match_partition (const std::string &dict_name, const dd::Partition *dd_part) |
Check if dd partition matches with innodb dictionary table name. More... | |
static void | get_table_parts (const std::string &dict_name, std::string &schema, std::string &table, std::string &partition, bool &is_tmp) |
Get table and partition string in system cs from dictionary name. More... | |
void | convert_to_space (std::string &dict_name) |
void | rebuild_space (const std::string &dict_name, std::string &space_name) |
void | rebuild (std::string &dict_name) |
Rebuild table name to convert from 5.7 format to 8.0. More... | |
Variables | |
constexpr char | PART_SEPARATOR [] = "#p#" |
Partition separator in dictionary table name and file name. More... | |
constexpr size_t | PART_SEPARATOR_LEN = sizeof(PART_SEPARATOR) - 1 |
Partition separator length excluding terminating NULL. More... | |
constexpr char | SUB_PART_SEPARATOR [] = "#sp#" |
Sub-Partition separator in dictionary table name and file name. More... | |
constexpr size_t | SUB_PART_SEPARATOR_LEN = sizeof(SUB_PART_SEPARATOR) - 1 |
Sub-Partition separator length excluding terminating NULL. More... | |
constexpr char | ALT_PART_SEPARATOR [] = "#P#" |
Alternative partition separator from 8.0.17 and older versions. More... | |
constexpr char | ALT_SUB_PART_SEPARATOR [] = "#SP#" |
Alternative sub-partition separator from 8.0.17 and older versions. More... | |
constexpr char | SCHEMA_SEPARATOR [] = "/" |
Schema separator is forward slash irrespective of platform. More... | |
constexpr size_t | SCHEMA_SEPARATOR_LEN = sizeof(SCHEMA_SEPARATOR) - 1 |
constexpr size_t | MAX_DB_UTF8MB3_LEN = NAME_LEN + 1 |
The maximum length in bytes that a database name can occupy when stored in UTF8MB3, including the terminating null. More... | |
constexpr size_t | MAX_DB_CHAR_LEN = NAME_CHAR_LEN |
The maximum length in characters for database name. More... | |
constexpr size_t | MAX_TABLE_UTF8MB3_LEN |
The maximum length in bytes that a table name can occupy when stored in UTF8MB3, including the terminating null. More... | |
constexpr size_t | MAX_TABLE_CHAR_LEN |
The maximum length in characters for table name. More... | |
constexpr char | TMP_POSTFIX [] = "#tmp" |
Postfix for a table name which is being altered. More... | |
constexpr size_t | TMP_POSTFIX_LEN = sizeof(TMP_POSTFIX) - 1 |
constexpr size_t | MAX_SPACE_NAME_LEN |
Maximum space name length. More... | |
Innodb data dictionary name.
NOTE: Innodb dictionary table name is always in my_charset_filename. Hence, dictionary name (dict_name) and partition string input parameters in dict_name:: interfaces are assumed to be in my_charset_filename.
using dict_name::Convert_Func = typedef std::function<void(std::string &)> |
Name string conversion callback.
Used for character set conversion.
void dict_name::build_57_partition | ( | const dd::Partition * | dd_part, |
std::string & | partition | ||
) |
Build 5.7 style partition string from dd object.
[in] | dd_part | partition object from DD |
[out] | partition | partition string for dictionary table name |
void dict_name::build_partition | ( | const dd::Partition * | dd_part, |
std::string & | partition | ||
) |
Build partition string from dd object.
[in] | dd_part | partition object from DD |
[out] | partition | partition string for dictionary table name |
|
static |
Build partition string from partition and sub-partition name.
[in] | part | partition name |
[in] | sub_part | sub-partition name |
[in] | conv | callback to convert partition/sub-partition name |
[in] | is_57 | if 5.7 style partition name is needed |
[out] | partition | partition string for dictionary table name |
void dict_name::build_table | ( | const std::string & | schema, |
const std::string & | table, | ||
const std::string & | partition, | ||
bool | is_tmp, | ||
bool | convert, | ||
std::string & | dict_name | ||
) |
|
static |
Check for partition and sub partition.
[in] | dict_name | name from innodb dictionary |
[in] | sub_part | true, if checking sub partition |
[out] | position | position of partition in string |
|
static |
Check for TMP extension name.
[in] | dict_name | name from innodb dictionary |
[out] | position | position of TMP extension in string |
void dict_name::convert_to_space | ( | std::string & | dict_name | ) |
void dict_name::file_to_table | ( | std::string & | name, |
bool | quiet | ||
) |
Conversion function to change for system to file name cs.
[in,out] | name | identifier name. |
[in] | quiet | true, if we allow error during conversion. |
|
static |
Get partition and sub-partition name from DD.
We convert the names to lower case.
[in] | dd_part | partition object from DD |
[in] | lower_case | convert to lower case name |
[out] | part_name | partition name |
[out] | sub_name | sub-partition name |
void dict_name::get_partition | ( | const std::string & | partition, |
bool | convert, | ||
std::string & | part, | ||
std::string & | sub_part | ||
) |
Get partition and sub-partition name from partition string.
[in] | partition | partition string from dictionary table name |
[in] | convert | convert partition names to system cs |
[out] | part | partition name |
[out] | sub_part | sub partition name if present |
|
static |
Get partition and sub-partition separator strings.
[in] | is_57 | true, if 5.7 style separator is needed |
[out] | part_sep | partition separator |
[out] | sub_part_sep | sub-partition separator |
void dict_name::get_table | ( | const std::string & | dict_name, |
bool | convert, | ||
std::string & | schema, | ||
std::string & | table, | ||
std::string & | partition, | ||
bool & | is_tmp | ||
) |
Get schema, table name, partition string and temporary attribute from dictionary table name.
[in] | dict_name | table name in dictionary |
[in] | convert | convert schema & table name to system cs |
[out] | schema | schema name |
[out] | table | table name |
[out] | partition | partition string if table partition |
[out] | is_tmp | true, iff temporary table created by DDL |
void dict_name::get_table | ( | const std::string & | dict_name, |
std::string & | schema, | ||
std::string & | table | ||
) |
Get schema and table name from dictionary table name.
[in] | dict_name | table name in dictionary |
[out] | schema | schema name |
[out] | table | table name |
|
static |
Get table and partition string in system cs from dictionary name.
[in] | dict_name | table name in dictionary |
[out] | schema | schema name |
[out] | table | table name |
[out] | partition | partition string |
[out] | is_tmp | true, if temporary table created by DDL |
bool dict_name::is_partition | ( | const std::string & | dict_name | ) |
Check if it is a table partition.
[in] | dict_name | table name in dictionary |
bool dict_name::match_partition | ( | const std::string & | dict_name, |
const dd::Partition * | dd_part | ||
) |
Check if dd partition matches with innodb dictionary table name.
[in] | dict_name | table name in innodb dictionary |
[in] | dd_part | partition object from DD |
std::optional< table_name_components > dict_name::parse_tablespace_path | ( | std::string | path | ) |
Get schema, table name, partition, subpartition and absolute directory from dictionary from filepath.
[in] | path | path where the ibd file is located |
void dict_name::rebuild | ( | std::string & | dict_name | ) |
Rebuild table name to convert from 5.7 format to 8.0.
[in,out] | dict_name | table name in dictionary |
void dict_name::rebuild_space | ( | const std::string & | dict_name, |
std::string & | space_name | ||
) |
void dict_name::table_to_file | ( | std::string & | name | ) |
Conversion function to change for file name to system cs.
[in,out] | name | identifier name. |
|
constexpr |
Alternative partition separator from 8.0.17 and older versions.
|
constexpr |
Alternative sub-partition separator from 8.0.17 and older versions.
|
constexpr |
The maximum length in characters for database name.
|
constexpr |
The maximum length in bytes that a database name can occupy when stored in UTF8MB3, including the terminating null.
|
constexpr |
Maximum space name length.
Space name includes schema name, table name along with partition and sub-partition name for partitioned table.
|
constexpr |
The maximum length in characters for table name.
|
constexpr |
The maximum length in bytes that a table name can occupy when stored in UTF8MB3, including the terminating null.
NAME_LEN is added 3 times to consider table name, partition name and sub-partition name for a partitioned table. In innodb each partition/sub-partition is a separate table named as below. table_name<PART_SEPARATOR>partition_name<SUB_PART_SEPARATOR>subpartition_name This macro only applies to table name, without any database name prefixed.
|
constexpr |
Partition separator in dictionary table name and file name.
|
constexpr |
Partition separator length excluding terminating NULL.
|
constexpr |
Schema separator is forward slash irrespective of platform.
|
constexpr |
|
constexpr |
Sub-Partition separator in dictionary table name and file name.
|
constexpr |
Sub-Partition separator length excluding terminating NULL.
|
constexpr |
Postfix for a table name which is being altered.
Since during ALTER TABLE ... PARTITION, new partitions have to be created before dropping existing partitions, so a postfix is appended to the name to prevent name conflicts. This is also used for EXCHANGE PARTITION
|
constexpr |