![]() |
MySQL 26.10.0
Source Code Documentation
|
Partition specific Handler_share. More...
#include <partition_handler.h>
Public Member Functions | |
| 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 |
Public Attributes | |
| 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... | |
Private Member Functions | |
| bool | insert_partition_name_in_hash (const char *name, uint part_id, bool is_subpart) |
| Insert [sub]partition name into partition_name_hash. More... | |
Private Attributes | |
| const uchar ** | partition_names |
Partition specific Handler_share.
| Partition_share::Partition_share | ( | ) |
|
override |
| const char * Partition_share::get_partition_name | ( | size_t | part_id | ) | const |
Get partition name.
| part_id | Partition id (for subpartitioned table only subpartition names will be returned.) |
| bool Partition_share::init_auto_inc_mutex | ( | TABLE_SHARE * | table_share | ) |
Initializes and sets auto_inc_mutex.
Initialize auto increment mutex in share.
Only needed to be called if the table have an auto increment. Must hold TABLE_SHARE::LOCK_ha_data when calling.
| true | Failure (out of memory). |
| false | Success. |
|
private |
Insert [sub]partition name into partition_name_hash.
| name | Partition name. |
| part_id | Partition id. |
| is_subpart | True if subpartition else partition. |
| false | Success. |
| true | Failure. |
|
inline |
lock mutex protecting auto increment value next_auto_inc_val.
| bool Partition_share::populate_partition_name_hash | ( | partition_info * | part_info | ) |
Populate partition_name_hash with partition and subpartition names from part_info.
Populate the partition_name_hash in part_share.
| part_info | Partition info containing all partitions metadata. |
| false | Success. |
| true | Failure. |
| void Partition_share::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.
| thd | Thread. |
| table_share | Table Share |
| next_insert_id | Next insert id (first non used auto inc value). |
| max_reserved | End of reserved auto inc range. |
|
inline |
unlock mutex protecting auto increment value next_auto_inc_val.
| bool Partition_share::auto_inc_initialized |
Set if auto increment is used an initialized.
| mysql_mutex_t* Partition_share::auto_inc_mutex |
Mutex protecting next_auto_inc_val.
Initialized if table uses auto increment.
| ulonglong Partition_share::next_auto_inc_val |
First non reserved auto increment value.
| std::unique_ptr< collation_unordered_map<std::string, unique_ptr_my_free<PART_NAME_DEF> > > Partition_share::partition_name_hash |
Hash of partition names.
Initialized by the first handler instance of a table_share calling populate_partition_name_hash(). After that it is read-only, i.e. no locking required for reading.
|
private |