MySQL 9.1.0
Source Code Documentation
|
Class(interface) which manages the operations for partitions of states in different categories during ALTER PARTITION. More...
Public Member Functions | |
virtual | ~alter_part ()=default |
Virtual destructor. More... | |
virtual uint | part_id () const |
Return the partition id. More... | |
virtual partition_state | state () const |
Return the partition state. More... | |
dict_table_t * | new_table () |
Get the InnoDB table object for newly created partition if applicable. More... | |
void | free_old_part (bool check_in_cache, const char *part_name) |
Set the freed old partition to nullptr to avoid dangling pointer. More... | |
virtual int | prepare (TABLE *altered_table, const dd::Partition *old_part, dd::Partition *new_part) |
Prepare. More... | |
virtual int | try_commit (const TABLE *table, TABLE *altered_table, const dd::Partition *old_part, dd::Partition *new_part) |
Try to commit. More... | |
virtual void | rollback () |
Rollback. More... | |
Protected Member Functions | |
alter_part (trx_t *trx, uint part_id, partition_state state, const char *table_name, dict_table_t **old) | |
Constructor. More... | |
bool | build_partition_name (const dd::Partition *dd_part, bool temp, char *name) |
Build the partition name for specified partition. More... | |
int | create (const dd::Table *part_table, const char *part_name, dd::Partition *dd_part, TABLE *table, const char *tablespace, bool file_per_table, uint64_t autoinc, uint64_t autoextend_size) |
Create a new partition. More... | |
Protected Attributes | |
trx_t *const | m_trx |
InnoDB transaction, nullptr if not used. More... | |
uint | m_part_id |
Partition id in the table. More... | |
partition_state | m_state |
Partition state of the partition on which this class will do operations. More... | |
const char * | m_table_name |
Partitioned table name, in form of . More... | |
dict_table_t ** | m_old |
The InnoDB table object for old partition. More... | |
dict_table_t * | m_new |
The InnoDB table object for newly created partition. More... | |
Class(interface) which manages the operations for partitions of states in different categories during ALTER PARTITION.
There are four categories for now:
|
virtualdefault |
Virtual destructor.
|
inlineprotected |
Constructor.
[in,out] | trx | InnoDB transaction, nullptr if not used |
[in] | part_id | Partition id in the table. This could be partition id for either old table or new table, callers should remember which one is applicable |
[in] | state | Partition state of the partition on which this class will do operations. If this is for one partition in new table, the partition state is the same for both the new partition and the corresponding old partition |
[in] | table_name | Partitioned table name, in the form of db/table, which considers the charset |
[in,out] | old | InnoDB table object for old partition, default is nullptr, which means there is no corresponding object |
|
protected |
Build the partition name for specified partition.
[in] | dd_part | dd::Partition |
[in] | temp | True if this is a temporary name |
[out] | name | Partition name buffer of length FN_REFLEN |
|
protected |
Create a new partition.
[in] | part_table | partition table |
[in] | part_name | Partition name, including db/table |
[in,out] | dd_part | dd::Partition |
[in] | table | Table format |
[in] | tablespace | Tablespace of this partition, if length is 0, it means no tablespace specified |
[in] | file_per_table | Current value of innodb_file_per_table |
[in] | autoinc | Next AUTOINC value to use |
[in] | autoextend_size | Value of AUTOEXTEND_SIZE for this tablespace |
|
inline |
Set the freed old partition to nullptr to avoid dangling pointer.
check_in_cache | whether we need to check table in cache |
part_name | Partitioned table name . |
|
inline |
Get the InnoDB table object for newly created partition if applicable.
|
inlinevirtual |
Return the partition id.
|
inlinevirtual |
Prepare.
[in,out] | altered_table | Table definition after the ALTER |
[in] | old_part | the stored old partition or nullptr if no corresponding one exists |
[in,out] | new_part | the stored new partition or nullptr if no corresponding one exists |
Reimplemented in alter_part_normal, alter_part_add, and alter_part_change.
|
inlinevirtual |
Rollback.
Reimplemented in alter_part_add, and alter_part_change.
|
inlinevirtual |
Return the partition state.
|
inlinevirtual |
Try to commit.
[in] | table | Table definition before the ALTER |
[in,out] | altered_table | Table definition after the ALTER |
[in] | old_part | the stored old partition or nullptr if no corresponding one exists |
[in,out] | new_part | the stored new partition or nullptr if no corresponding one exists |
Reimplemented in alter_part_normal, alter_part_add, alter_part_drop, and alter_part_change.
|
protected |
The InnoDB table object for newly created partition.
|
protected |
The InnoDB table object for old partition.
|
protected |
Partition id in the table.
This could be partition id for either old table or new table, callers should remember which one is applicable
|
protected |
Partition state of the partition on which this class will do operations.
If this is for one partition in new table, the partition state is the same for both the new partition and the corresponding old partition
|
protected |
Partitioned table name, in form of .
/db/table, which already considers the charset
|
protected |
InnoDB transaction, nullptr if not used.