MySQL 8.4.2
Source Code Documentation
Partition_handler Class Referenceabstract

Class for partitioning specific operations. More...

#include <partition_handler.h>

Inheritance diagram for Partition_handler:
[legend]

Public Member Functions

 Partition_handler ()=default
 
virtual ~Partition_handler ()=default
 
virtual void get_dynamic_partition_info (ha_statistics *stat_info, ha_checksum *check_sum, uint part_id)=0
 Get dynamic table information from partition. More...
 
virtual int get_default_num_partitions (HA_CREATE_INFO *info)
 Get default number of partitions. More...
 
virtual void set_auto_partitions (partition_info *part_info)
 Setup auto partitioning. More...
 
virtual bool get_num_parts (const char *name, uint *num_parts)
 Get number of partitions for table in SE. More...
 
virtual void set_part_info (partition_info *part_info, bool early)=0
 Set the partition info object to be used by the handler. More...
 
int truncate_partition (dd::Table *table_def)
 Truncate partitions. More...
 
int exchange_partition (uint part_id, dd::Table *part_table_def, dd::Table *swap_table_def)
 Exchange partition. More...
 
virtual uint alter_flags (uint flags) const
 Alter flags. More...
 
virtual enum row_type get_partition_row_type (const dd::Table *table, uint part_id)=0
 Get partition row type from SE. More...
 

Private Member Functions

virtual int truncate_partition_low (dd::Table *)
 Truncate partition. More...
 
virtual int exchange_partition_low (uint part_id, dd::Table *part_table_def, dd::Table *swap_table_def)
 Exchange partition. More...
 
virtual handlerget_handler ()
 Return the table handler. More...
 

Detailed Description

Class for partitioning specific operations.

Returned from handler::get_partition_handler().

Constructor & Destructor Documentation

◆ Partition_handler()

Partition_handler::Partition_handler ( )
default

◆ ~Partition_handler()

virtual Partition_handler::~Partition_handler ( )
virtualdefault

Member Function Documentation

◆ alter_flags()

virtual uint Partition_handler::alter_flags ( uint  flags) const
inlinevirtual

Alter flags.

Given a set of alter table flags, return which is supported.

Parameters
flagsAlter table operation flags.
Returns
Supported alter table flags.

Reimplemented in ha_innopart.

◆ exchange_partition()

int Partition_handler::exchange_partition ( uint  part_id,
dd::Table part_table_def,
dd::Table swap_table_def 
)

Exchange partition.

Parameters
[in]part_idId of partition to be exchanged.
[in,out]part_table_defdd::Table object for partitioned table.
[in,out]swap_table_defdd::Table object for non-partitioned table.
Note
Both tables are locked in exclusive mode.
Changes to dd::Table object done by this method will be saved to data-dictionary only if storage engine supporting atomic DDL (i.e. with HTON_SUPPORTS_ATOMIC_DDL flag).
Returns
Operation status.
Return values
0Success.
!=0 Error code.

◆ exchange_partition_low()

virtual int Partition_handler::exchange_partition_low ( uint  part_id,
dd::Table part_table_def,
dd::Table swap_table_def 
)
inlineprivatevirtual

Exchange partition.

Low-level primitive which implementation to be provided by SE.

See also
Partition_handler::exchange_partition().

Reimplemented in ha_innopart.

◆ get_default_num_partitions()

virtual int Partition_handler::get_default_num_partitions ( HA_CREATE_INFO info)
inlinevirtual

Get default number of partitions.

Used during creating a partitioned table.

Parameters
infoCreate info.
Returns
Number of default partitions.

◆ get_dynamic_partition_info()

virtual void Partition_handler::get_dynamic_partition_info ( ha_statistics stat_info,
ha_checksum check_sum,
uint  part_id 
)
pure virtual

Get dynamic table information from partition.

Parameters
[out]stat_infoStatistics struct to fill in.
[out]check_sumCheck sum value to fill in if supported.
[in]part_idPartition to report for.
Note
stat_info and check_sum are initialized by caller. check_sum is only expected to be updated if HA_HAS_CHECKSUM.

Implemented in ha_innopart.

◆ get_handler()

virtual handler * Partition_handler::get_handler ( )
inlineprivatevirtual

Return the table handler.

For some partitioning specific functions it is still needed to access the handler directly for transaction handling (mark_trx_read_write()) and to assert correct locking.

Returns
handler or NULL if not supported.

Reimplemented in ha_innopart.

◆ get_num_parts()

virtual bool Partition_handler::get_num_parts ( const char *  name,
uint *  num_parts 
)
inlinevirtual

Get number of partitions for table in SE.

Parameters
namenormalized path(same as open) to the table
[out]num_partsNumber of partitions
Return values
falsefor success
truefor failure, for example table didn't exist in engine

◆ get_partition_row_type()

virtual enum row_type Partition_handler::get_partition_row_type ( const dd::Table table,
uint  part_id 
)
pure virtual

Get partition row type from SE.

Parameters
tablepartition table
part_idId of partition for which row type to be retrieved
Returns
Partition row type.

Implemented in ha_innopart.

◆ set_auto_partitions()

virtual void Partition_handler::set_auto_partitions ( partition_info part_info)
inlinevirtual

Setup auto partitioning.

Called for engines with HA_USE_AUTO_PARTITION to setup the partition info object

Parameters
[in,out]part_infoPartition object to setup.

◆ set_part_info()

virtual void Partition_handler::set_part_info ( partition_info part_info,
bool  early 
)
pure virtual

Set the partition info object to be used by the handler.

Parameters
part_infoPartition info to be used by the handler.
earlyTrue if called when part_info only created and parsed, but not setup, checked or fixed.

Implemented in ha_innopart.

◆ truncate_partition()

int Partition_handler::truncate_partition ( dd::Table table_def)

Truncate partitions.

Truncate all partitions matching table->part_info->read_partitions. Handler level wrapper for truncating partitions, will ensure that mark_trx_read_write() is called and also checks locking assertions.

Parameters
[in,out]table_defdd::Table object for the table. Engines which support atomic DDL are allowed to adjust this object. Changes will be saved to the data-dictionary.
Returns
Operation status.
Return values
0Success.
!=0 Error code.

◆ truncate_partition_low()

virtual int Partition_handler::truncate_partition_low ( dd::Table )
inlineprivatevirtual

Truncate partition.

Low-level primitive for handler, implementing Partition_handler::truncate_partition().

See also
Partition_handler::truncate_partition().

Reimplemented in ha_innopart.


The documentation for this class was generated from the following files: