MySQL 8.0.40
Source Code Documentation
|
InnoDB partition specific Handler_share. More...
#include <ha_innopart.h>
Public Member Functions | |
Ha_innopart_share (TABLE_SHARE *table_share) | |
~Ha_innopart_share () override | |
void | set_table_part (uint part_id, dict_table_t *table) |
Set innodb table for given partition. More... | |
dict_table_t ** | get_table_part_ref (uint part_id) |
Get table reference for given partition. More... | |
dict_table_t * | get_table_part (uint part_id) const |
Return innodb table for given partition. More... | |
dict_index_t * | get_index (uint part_id, uint keynr) |
Return innodb index for given partition and key number. More... | |
uint | get_mysql_key (uint part_id, const dict_index_t *index) |
Get MySQL key number corresponding to InnoDB index. More... | |
bool | has_table_parts () const |
Return whether share has opened InnoDB tables for partitions. More... | |
void | increment_ref_counts () |
Increment share and InnoDB tables reference counters. More... | |
bool | set_table_parts_and_indexes (partition_info *part_info, dict_table_t **table_parts) |
Initialize the share with table and indexes per partition. More... | |
void | close_table_parts () |
Close the table partitions. More... | |
const TABLE_SHARE * | get_table_share () const |
uint | get_num_parts () const |
Get the number of partitions. More... | |
void | set_v_templ (TABLE *table, dict_table_t *ib_table, const char *name) |
Set up the virtual column template for partition table, and points all m_table_parts[]->vc_templ to it. More... | |
Public Member Functions inherited from Partition_share | |
Partition_share () | |
~Partition_share () override | |
bool | init_auto_inc_mutex (TABLE_SHARE *table_share) |
Initializes and sets auto_inc_mutex. More... | |
void | release_auto_inc_if_possible (THD *thd, TABLE_SHARE *table_share, const ulonglong next_insert_id, const ulonglong max_reserved) |
Release reserved auto increment values not used. More... | |
void | lock_auto_inc () |
lock mutex protecting auto increment value next_auto_inc_val. More... | |
void | unlock_auto_inc () |
unlock mutex protecting auto increment value next_auto_inc_val. More... | |
bool | populate_partition_name_hash (partition_info *part_info) |
Populate partition_name_hash with partition and subpartition names from part_info. More... | |
const char * | get_partition_name (size_t part_id) const |
Get partition name. More... | |
Public Member Functions inherited from Handler_share | |
Handler_share ()=default | |
virtual | ~Handler_share ()=default |
Static Public Member Functions | |
static dict_table_t ** | open_table_parts (THD *thd, const TABLE *table, const dd::Table *dd_table, partition_info *part_info, const char *table_name) |
Open InnoDB tables for partitions and return them as array. More... | |
static void | close_table_parts (dict_table_t **table_parts, uint tot_parts) |
Close InnoDB tables for partitions. More... | |
Private Member Functions | |
Ha_innopart_share ()=default | |
Disable default constructor. More... | |
Static Private Member Functions | |
static bool | open_one_table_part (dd::cache::Dictionary_client *client, THD *thd, const TABLE *table, const dd::Partition *dd_part, const char *part_name, dict_table_t **part_dict_table) |
Open one partition. More... | |
Private Attributes | |
dict_table_t ** | m_table_parts |
Array of all included table definitions (one per partition). More... | |
dict_index_t ** | m_index_mapping |
Instead of INNOBASE_SHARE::idx_trans_tbl. More... | |
uint | m_tot_parts |
Total number of partitions. More... | |
uint | m_index_count |
Number of indexes. More... | |
uint | m_ref_count |
Reference count. More... | |
TABLE_SHARE * | m_table_share |
Pointer back to owning TABLE_SHARE. More... | |
Additional Inherited Members | |
Public Attributes inherited from Partition_share | |
bool | auto_inc_initialized |
Set if auto increment is used an initialized. More... | |
mysql_mutex_t * | auto_inc_mutex |
Mutex protecting next_auto_inc_val. More... | |
ulonglong | next_auto_inc_val |
First non reserved auto increment value. More... | |
std::unique_ptr< collation_unordered_map< std::string, unique_ptr_my_free< PART_NAME_DEF > > > | partition_name_hash |
Hash of partition names. More... | |
InnoDB partition specific Handler_share.
Ha_innopart_share::Ha_innopart_share | ( | TABLE_SHARE * | table_share | ) |
|
override |
|
privatedefault |
Disable default constructor.
void Ha_innopart_share::close_table_parts | ( | void | ) |
Close the table partitions.
If all instances are closed, also release the resources.
|
static |
Close InnoDB tables for partitions.
[in] | table_parts | Array of InnoDB tables for partitions. |
[in] | tot_parts | Number of partitions. |
|
inline |
Return innodb index for given partition and key number.
[in] | part_id | Partition number. |
[in] | keynr | Key number. |
|
inline |
Get MySQL key number corresponding to InnoDB index.
Calculates the key number used inside MySQL for an Innobase index. We will first check the "index translation table" for a match of the index to get the index number. If there does not exist an "index translation table", or not able to find the index in the translation table, then we will fall back to the traditional way of looping through dict_index_t list to find a match. In this case, we have to take into account if we generated a default clustered index for the table
[in] | part_id | Partition the index belongs to. |
[in] | index | Index to return MySQL key number for. |
|
inline |
Get the number of partitions.
|
inline |
Return innodb table for given partition.
[in] | part_id | Partition number. |
|
inline |
Get table reference for given partition.
[in] | part_id | Partition number |
|
inline |
|
inline |
Return whether share has opened InnoDB tables for partitions.
void Ha_innopart_share::increment_ref_counts | ( | ) |
Increment share and InnoDB tables reference counters.
|
staticprivate |
Open one partition.
[in,out] | client | Data dictionary client |
[in] | thd | Thread THD |
[in] | table | MySQL table definition |
[in] | dd_part | dd::Partition |
[in] | part_name | Table name of this partition |
[out] | part_dict_table | InnoDB table for partition |
false | On success |
true | On failure |
|
static |
Open InnoDB tables for partitions and return them as array.
[in,out] | thd | Thread context |
[in] | table | MySQL table definition |
[in] | dd_table | Global DD table object |
[in] | part_info | Partition info (partition names to use) |
[in] | table_name | Table name (db/table_name) |
|
inline |
Set innodb table for given partition.
[in] | part_id | Partition number. |
[in] | table | Table. |
bool Ha_innopart_share::set_table_parts_and_indexes | ( | partition_info * | part_info, |
dict_table_t ** | table_parts | ||
) |
Initialize the share with table and indexes per partition.
[in] | part_info | Partition info (partition names to use). |
[in] | table_parts | Array of InnoDB tables for partitions. |
void Ha_innopart_share::set_v_templ | ( | TABLE * | table, |
dict_table_t * | ib_table, | ||
const char * | name | ||
) |
Set up the virtual column template for partition table, and points all m_table_parts[]->vc_templ to it.
[in] | table | MySQL TABLE object |
[in] | ib_table | InnoDB dict_table_t |
[in] | name | Table name (db/table_name) |
|
private |
Number of indexes.
|
private |
Instead of INNOBASE_SHARE::idx_trans_tbl.
Maps MySQL index number to InnoDB index per partition.
|
private |
Reference count.
|
private |
Array of all included table definitions (one per partition).
|
private |
Pointer back to owning TABLE_SHARE.
|
private |
Total number of partitions.