MySQL 8.4.3
Source Code Documentation
On-line ALTER TABLE interface

Functions

enum_alter_inplace_result ha_innopart::check_if_supported_inplace_alter (TABLE *altered_table, Alter_inplace_info *ha_alter_info) override
 Check if InnoDB supports a particular alter table in-place. More...
 
bool ha_innopart::prepare_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def) override
 Prepare in-place ALTER for table. More...
 
bool ha_innopart::inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def) override
 Alter the table structure in-place. More...
 
bool ha_innopart::commit_inplace_alter_table (TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_table_def, dd::Table *new_table_def) override
 Commit or rollback. More...
 

Detailed Description

See also
handler0alter.cc

Function Documentation

◆ check_if_supported_inplace_alter()

enum_alter_inplace_result ha_innopart::check_if_supported_inplace_alter ( TABLE altered_table,
Alter_inplace_info ha_alter_info 
)
overridevirtual

Check if InnoDB supports a particular alter table in-place.

Parameters
[in]altered_tableTABLE object for new version of table.
[in,out]ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
Return values
HA_ALTER_INPLACE_NOT_SUPPORTEDNot supported
HA_ALTER_INPLACE_NO_LOCKSupported
HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARESupported, but requires lock during main phase and exclusive lock during prepare phase.
HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARESupported, prepare phase requires exclusive lock.

Reimplemented from ha_innobase.

◆ commit_inplace_alter_table()

bool ha_innopart::commit_inplace_alter_table ( TABLE altered_table,
Alter_inplace_info ha_alter_info,
bool  commit,
const dd::Table old_table_def,
dd::Table new_table_def 
)
overridevirtual

Commit or rollback.

Commit or rollback the changes made during prepare_inplace_alter_table() and inplace_alter_table() inside the storage engine. Note that the allowed level of concurrency during this operation will be the same as for inplace_alter_table() and thus might be higher than during prepare_inplace_alter_table(). (E.g concurrent writes were blocked during prepare, but might not be during commit).

Parameters
[in]altered_tableTABLE object for new version of table.
[in,out]ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
[in]committrue => Commit, false => Rollback.
[in]old_table_defdd::Table object describing old version of the table.
[in,out]new_table_defdd::Table object for the new version of the table. Can be adjusted by this call. Changes to the table definition will be persisted in the data-dictionary at statement commit time.
Return values
trueFailure.
falseSuccess.

Reimplemented from ha_innobase.

◆ inplace_alter_table()

bool ha_innopart::inplace_alter_table ( TABLE altered_table,
Alter_inplace_info ha_alter_info,
const dd::Table old_table_def,
dd::Table new_table_def 
)
overridevirtual

Alter the table structure in-place.

Alter the table structure in-place with operations specified using HA_ALTER_FLAGS and Alter_inplace_information. The level of concurrency allowed during this operation depends on the return value from check_if_supported_inplace_alter().

Parameters
[in]altered_tableTABLE object for new version of table.
[in,out]ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
[in]old_table_defdd::Table object describing old version of the table.
[in,out]new_table_defdd::Table object for the new version of the table. Can be adjusted by this call. Changes to the table definition will be persisted in the data-dictionary at statement commit time.
Return values
trueFailure.
falseSuccess.

Reimplemented from ha_innobase.

◆ prepare_inplace_alter_table()

bool ha_innopart::prepare_inplace_alter_table ( TABLE altered_table,
Alter_inplace_info ha_alter_info,
const dd::Table old_table_def,
dd::Table new_table_def 
)
overridevirtual

Prepare in-place ALTER for table.

Allows InnoDB to update internal structures with concurrent writes blocked (provided that check_if_supported_inplace_alter() did not return HA_ALTER_INPLACE_NO_LOCK). This will be invoked before inplace_alter_table().

Parameters
[in]altered_tableTABLE object for new version of table.
[in,out]ha_alter_infoStructure describing changes to be done by ALTER TABLE and holding data used during in-place alter.
[in]old_table_defdd::Table object describing old version of the table.
[in,out]new_table_defdd::Table object for the new version of the table. Can be adjusted by this call. Changes to the table definition will be persisted in the data-dictionary at statement commit time.
Return values
trueFailure.
falseSuccess.

Reimplemented from ha_innobase.