MySQL 8.3.0
Source Code Documentation
Alter_inplace_info Class Reference

Class describing changes to be done by ALTER TABLE. More...

#include <handler.h>

Public Types

typedef ulonglong HA_ALTER_FLAGS
 Bits to show in detail what operations the storage engine is to execute. More...
 

Public Member Functions

 Alter_inplace_info (HA_CREATE_INFO *create_info_arg, Alter_info *alter_info_arg, bool error_if_not_empty_arg, KEY *key_info_arg, uint key_count_arg, partition_info *modified_part_info_arg)
 
 ~Alter_inplace_info ()
 
void report_unsupported_error (const char *not_supported, const char *try_instead)
 Used after check_if_supported_inplace_alter() to report error if the result does not match the LOCK/ALGORITHM requirements set by the user. More...
 
void add_renamed_key (KEY *old_key, KEY *new_key)
 Add old and new version of key to array of indexes to be renamed. More...
 
void add_altered_index_visibility (KEY *old_key, KEY *new_key)
 
void add_modified_key (KEY *old_key, KEY *new_key)
 Add old and new version of modified key to arrays of indexes to be dropped and added (correspondingly). More...
 
void add_dropped_key (KEY *old_key)
 Drop key to array of indexes to be dropped. More...
 
void add_added_key (KEY *new_key)
 Add key to array of indexes to be added. More...
 

Public Attributes

HA_CREATE_INFOcreate_info
 Create options (like MAX_ROWS) for the new version of table. More...
 
Alter_infoalter_info
 Alter options, fields and keys for the new version of table. More...
 
bool error_if_not_empty
 Indicates whether operation should fail if table is non-empty. More...
 
KEYkey_info_buffer
 Array of KEYs for new version of table - including KEYs to be added. More...
 
uint key_count
 Size of key_info_buffer array. More...
 
uint index_drop_count
 Size of index_drop_buffer array. More...
 
KEY ** index_drop_buffer
 Array of pointers to KEYs to be dropped belonging to the TABLE instance for the old version of the table. More...
 
uint index_add_count
 Size of index_add_buffer array. More...
 
uint * index_add_buffer
 Array of indexes into key_info_buffer for KEYs to be added, sorted in increasing order. More...
 
uint index_rename_count
 Size of index_rename_buffer array. More...
 
uint index_altered_visibility_count
 Size of index_rename_buffer array. More...
 
KEY_PAIRindex_rename_buffer
 Array of KEY_PAIR objects describing indexes being renamed. More...
 
KEY_PAIRindex_altered_visibility_buffer
 
uint virtual_column_add_count
 Number of virtual columns to be added. More...
 
uint virtual_column_drop_count
 number of virtual columns to be dropped. More...
 
inplace_alter_handler_ctxhandler_ctx
 Context information to allow handlers to keep context between in-place alter API calls. More...
 
inplace_alter_handler_ctx ** group_commit_ctx
 If the table uses several handlers, like ha_partition uses one handler per partition, this contains a Null terminated array of ctx pointers that should all be committed together. More...
 
HA_ALTER_FLAGS handler_flags
 Flags describing in detail which operations the storage engine is to execute. More...
 
partition_infomodified_part_info
 Partition_info taking into account the partition changes to be performed. More...
 
bool online
 true for online operation (LOCK=NONE) More...
 
uint handler_trivial_ctx
 Can be set by handler along with handler_ctx. More...
 
const char * unsupported_reason
 Can be set by handler to describe why a given operation cannot be done in-place (HA_ALTER_INPLACE_NOT_SUPPORTED) or why it cannot be done online (HA_ALTER_INPLACE_NO_LOCK or HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE) If set, it will be used with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON if results from handler::check_if_supported_inplace_alter() doesn't match requirements set by user. More...
 

Static Public Attributes

static const HA_ALTER_FLAGS ADD_INDEX = 1ULL << 0
 
static const HA_ALTER_FLAGS DROP_INDEX = 1ULL << 1
 
static const HA_ALTER_FLAGS ADD_UNIQUE_INDEX = 1ULL << 2
 
static const HA_ALTER_FLAGS DROP_UNIQUE_INDEX = 1ULL << 3
 
static const HA_ALTER_FLAGS ADD_PK_INDEX = 1ULL << 4
 
static const HA_ALTER_FLAGS DROP_PK_INDEX = 1ULL << 5
 
static const HA_ALTER_FLAGS ADD_VIRTUAL_COLUMN = 1ULL << 6
 
static const HA_ALTER_FLAGS ADD_STORED_BASE_COLUMN = 1ULL << 7
 
static const HA_ALTER_FLAGS ADD_STORED_GENERATED_COLUMN = 1ULL << 8
 
static const HA_ALTER_FLAGS ADD_COLUMN
 
static const HA_ALTER_FLAGS DROP_VIRTUAL_COLUMN = 1ULL << 9
 
static const HA_ALTER_FLAGS DROP_STORED_COLUMN = 1ULL << 10
 
static const HA_ALTER_FLAGS DROP_COLUMN
 
static const HA_ALTER_FLAGS ALTER_COLUMN_NAME = 1ULL << 11
 
static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_TYPE = 1ULL << 12
 
static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_TYPE = 1ULL << 13
 
static const HA_ALTER_FLAGS ALTER_COLUMN_EQUAL_PACK_LENGTH = 1ULL << 14
 Change column datatype in such way that new type has compatible packed representation with old type, so it is theoretically possible to perform change by only updating data dictionary without changing table rows. More...
 
static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_ORDER = 1ULL << 15
 A virtual column has changed its position. More...
 
static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_ORDER = 1ULL << 16
 A stored column has changed its position (disregarding virtual columns) More...
 
static const HA_ALTER_FLAGS ALTER_COLUMN_NULLABLE = 1ULL << 17
 
static const HA_ALTER_FLAGS ALTER_COLUMN_NOT_NULLABLE = 1ULL << 18
 
static const HA_ALTER_FLAGS ALTER_COLUMN_DEFAULT = 1ULL << 19
 
static const HA_ALTER_FLAGS ALTER_VIRTUAL_GCOL_EXPR = 1ULL << 20
 
static const HA_ALTER_FLAGS ALTER_STORED_GCOL_EXPR = 1ULL << 21
 
static const HA_ALTER_FLAGS ADD_FOREIGN_KEY = 1ULL << 22
 
static const HA_ALTER_FLAGS DROP_FOREIGN_KEY = 1ULL << 23
 
static const HA_ALTER_FLAGS CHANGE_CREATE_OPTION = 1ULL << 24
 
static const HA_ALTER_FLAGS ALTER_RENAME = 1ULL << 25
 
static const HA_ALTER_FLAGS ALTER_COLUMN_STORAGE_TYPE = 1ULL << 26
 
static const HA_ALTER_FLAGS ALTER_COLUMN_COLUMN_FORMAT = 1ULL << 27
 
static const HA_ALTER_FLAGS ADD_PARTITION = 1ULL << 28
 
static const HA_ALTER_FLAGS DROP_PARTITION = 1ULL << 29
 
static const HA_ALTER_FLAGS ALTER_PARTITION = 1ULL << 30
 
static const HA_ALTER_FLAGS COALESCE_PARTITION = 1ULL << 31
 
static const HA_ALTER_FLAGS REORGANIZE_PARTITION = 1ULL << 32
 
static const HA_ALTER_FLAGS ALTER_TABLE_REORG = 1ULL << 33
 
static const HA_ALTER_FLAGS ALTER_REMOVE_PARTITIONING = 1ULL << 34
 
static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1ULL << 35
 
static const HA_ALTER_FLAGS RENAME_INDEX = 1ULL << 36
 Rename index. More...
 
static const HA_ALTER_FLAGS RECREATE_TABLE = 1ULL << 37
 Recreate the table for ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE operations. More...
 
static const HA_ALTER_FLAGS ADD_SPATIAL_INDEX = 1ULL << 38
 
static const HA_ALTER_FLAGS ALTER_INDEX_COMMENT = 1ULL << 39
 
static const HA_ALTER_FLAGS VALIDATE_VIRTUAL_COLUMN = 1ULL << 40
 
static const HA_ALTER_FLAGS CHANGE_INDEX_OPTION = 1LL << 41
 Change index option in a way which is likely not to require index recreation. More...
 
static const HA_ALTER_FLAGS ALTER_REBUILD_PARTITION = 1ULL << 42
 
static const HA_ALTER_FLAGS ALTER_COLUMN_INDEX_LENGTH = 1ULL << 43
 Change in index length such that it does not require index rebuild. More...
 
static const HA_ALTER_FLAGS VIRTUAL_GCOL_REEVAL = 1ULL << 44
 Change to one of columns on which virtual generated column depends, so its values require re-evaluation. More...
 
static const HA_ALTER_FLAGS STORED_GCOL_REEVAL = 1ULL << 45
 Change to one of columns on which stored generated column depends, so its values require re-evaluation. More...
 
static const HA_ALTER_FLAGS ADD_CHECK_CONSTRAINT = 1ULL << 46
 
static const HA_ALTER_FLAGS DROP_CHECK_CONSTRAINT = 1ULL << 47
 
static const HA_ALTER_FLAGS SUSPEND_CHECK_CONSTRAINT = 1ULL << 48
 
static const HA_ALTER_FLAGS ALTER_COLUMN_VISIBILITY = 1ULL << 49
 

Detailed Description

Class describing changes to be done by ALTER TABLE.

Instance of this class is passed to storage engine in order to determine if this ALTER TABLE can be done using in-place algorithm. It is also used for executing the ALTER TABLE using in-place algorithm.

Member Typedef Documentation

◆ HA_ALTER_FLAGS

Bits to show in detail what operations the storage engine is to execute.

All these operations are supported as in-place operations by the SQL layer. This means that operations that by their nature must be performed by copying the table to a temporary table, will not have their own flags here (e.g. ALTER TABLE FORCE, ALTER TABLE ENGINE).

We generally try to specify handler flags only if there are real changes. But in cases when it is cumbersome to determine if some attribute has really changed we might choose to set flag pessimistically, for example, relying on parser output only.

Constructor & Destructor Documentation

◆ Alter_inplace_info()

Alter_inplace_info::Alter_inplace_info ( HA_CREATE_INFO create_info_arg,
Alter_info alter_info_arg,
bool  error_if_not_empty_arg,
KEY key_info_arg,
uint  key_count_arg,
partition_info modified_part_info_arg 
)
inline

◆ ~Alter_inplace_info()

Alter_inplace_info::~Alter_inplace_info ( )
inline

Member Function Documentation

◆ add_added_key()

void Alter_inplace_info::add_added_key ( KEY new_key)
inline

Add key to array of indexes to be added.

◆ add_altered_index_visibility()

void Alter_inplace_info::add_altered_index_visibility ( KEY old_key,
KEY new_key 
)
inline

◆ add_dropped_key()

void Alter_inplace_info::add_dropped_key ( KEY old_key)
inline

Drop key to array of indexes to be dropped.

◆ add_modified_key()

void Alter_inplace_info::add_modified_key ( KEY old_key,
KEY new_key 
)
inline

Add old and new version of modified key to arrays of indexes to be dropped and added (correspondingly).

◆ add_renamed_key()

void Alter_inplace_info::add_renamed_key ( KEY old_key,
KEY new_key 
)
inline

Add old and new version of key to array of indexes to be renamed.

◆ report_unsupported_error()

void Alter_inplace_info::report_unsupported_error ( const char *  not_supported,
const char *  try_instead 
)

Used after check_if_supported_inplace_alter() to report error if the result does not match the LOCK/ALGORITHM requirements set by the user.

Parameters
not_supportedPart of statement that was not supported.
try_insteadSuggestion as to what the user should replace not_supported with.

Member Data Documentation

◆ ADD_CHECK_CONSTRAINT

const HA_ALTER_FLAGS Alter_inplace_info::ADD_CHECK_CONSTRAINT = 1ULL << 46
static

◆ ADD_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::ADD_COLUMN
static
Initial value:
=
static const HA_ALTER_FLAGS ADD_VIRTUAL_COLUMN
Definition: handler.h:3368
static const HA_ALTER_FLAGS ADD_STORED_GENERATED_COLUMN
Definition: handler.h:3372
static const HA_ALTER_FLAGS ADD_STORED_BASE_COLUMN
Definition: handler.h:3370

◆ ADD_FOREIGN_KEY

const HA_ALTER_FLAGS Alter_inplace_info::ADD_FOREIGN_KEY = 1ULL << 22
static

◆ ADD_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::ADD_INDEX = 1ULL << 0
static

◆ ADD_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::ADD_PARTITION = 1ULL << 28
static

◆ ADD_PK_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::ADD_PK_INDEX = 1ULL << 4
static

◆ ADD_SPATIAL_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::ADD_SPATIAL_INDEX = 1ULL << 38
static

◆ ADD_STORED_BASE_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::ADD_STORED_BASE_COLUMN = 1ULL << 7
static

◆ ADD_STORED_GENERATED_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::ADD_STORED_GENERATED_COLUMN = 1ULL << 8
static

◆ ADD_UNIQUE_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::ADD_UNIQUE_INDEX = 1ULL << 2
static

◆ ADD_VIRTUAL_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::ADD_VIRTUAL_COLUMN = 1ULL << 6
static

◆ ALTER_ALL_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_ALL_PARTITION = 1ULL << 35
static

◆ ALTER_COLUMN_COLUMN_FORMAT

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT = 1ULL << 27
static

◆ ALTER_COLUMN_DEFAULT

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_DEFAULT = 1ULL << 19
static

◆ ALTER_COLUMN_EQUAL_PACK_LENGTH

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH = 1ULL << 14
static

Change column datatype in such way that new type has compatible packed representation with old type, so it is theoretically possible to perform change by only updating data dictionary without changing table rows.

◆ ALTER_COLUMN_INDEX_LENGTH

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_INDEX_LENGTH = 1ULL << 43
static

Change in index length such that it does not require index rebuild.

For example, change in index length due to column expansion like varchar(X) changed to varchar(X + N).

◆ ALTER_COLUMN_NAME

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_NAME = 1ULL << 11
static

◆ ALTER_COLUMN_NOT_NULLABLE

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE = 1ULL << 18
static

◆ ALTER_COLUMN_NULLABLE

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_NULLABLE = 1ULL << 17
static

◆ ALTER_COLUMN_STORAGE_TYPE

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE = 1ULL << 26
static

◆ ALTER_COLUMN_VISIBILITY

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_VISIBILITY = 1ULL << 49
static

◆ ALTER_INDEX_COMMENT

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_INDEX_COMMENT = 1ULL << 39
static

◆ alter_info

Alter_info* Alter_inplace_info::alter_info

Alter options, fields and keys for the new version of table.

Note
The referenced instance of Alter_info object was already used to create new .FRM file for table being altered. So it has been processed by mysql_prepare_create_table() already. In particular, this means that in Create_field objects for fields which were present in some form in the old version of table, Create_field::field member points to corresponding Field instance for old version of table.

◆ ALTER_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_PARTITION = 1ULL << 30
static

◆ ALTER_REBUILD_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_REBUILD_PARTITION = 1ULL << 42
static

◆ ALTER_REMOVE_PARTITIONING

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_REMOVE_PARTITIONING = 1ULL << 34
static

◆ ALTER_RENAME

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_RENAME = 1ULL << 25
static

◆ ALTER_STORED_COLUMN_ORDER

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_STORED_COLUMN_ORDER = 1ULL << 16
static

A stored column has changed its position (disregarding virtual columns)

◆ ALTER_STORED_COLUMN_TYPE

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_STORED_COLUMN_TYPE = 1ULL << 13
static

◆ ALTER_STORED_GCOL_EXPR

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_STORED_GCOL_EXPR = 1ULL << 21
static

◆ ALTER_TABLE_REORG

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_TABLE_REORG = 1ULL << 33
static

◆ ALTER_VIRTUAL_COLUMN_ORDER

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER = 1ULL << 15
static

A virtual column has changed its position.

◆ ALTER_VIRTUAL_COLUMN_TYPE

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE = 1ULL << 12
static

◆ ALTER_VIRTUAL_GCOL_EXPR

const HA_ALTER_FLAGS Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR = 1ULL << 20
static

◆ CHANGE_CREATE_OPTION

const HA_ALTER_FLAGS Alter_inplace_info::CHANGE_CREATE_OPTION = 1ULL << 24
static

◆ CHANGE_INDEX_OPTION

const HA_ALTER_FLAGS Alter_inplace_info::CHANGE_INDEX_OPTION = 1LL << 41
static

Change index option in a way which is likely not to require index recreation.

For example, change COMMENT or KEY::is_algorithm_explicit flag (without change of index algorithm itself).

◆ COALESCE_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::COALESCE_PARTITION = 1ULL << 31
static

◆ create_info

HA_CREATE_INFO* Alter_inplace_info::create_info

Create options (like MAX_ROWS) for the new version of table.

Note
The referenced instance of HA_CREATE_INFO object was already used to create new .FRM file for table being altered. So it has been processed by mysql_prepare_create_table() already. For example, this means that it has HA_OPTION_PACK_RECORD flag in HA_CREATE_INFO::table_options member correctly set.

◆ DROP_CHECK_CONSTRAINT

const HA_ALTER_FLAGS Alter_inplace_info::DROP_CHECK_CONSTRAINT = 1ULL << 47
static

◆ DROP_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::DROP_COLUMN
static
Initial value:
=
static const HA_ALTER_FLAGS DROP_VIRTUAL_COLUMN
Definition: handler.h:3378
static const HA_ALTER_FLAGS DROP_STORED_COLUMN
Definition: handler.h:3379

◆ DROP_FOREIGN_KEY

const HA_ALTER_FLAGS Alter_inplace_info::DROP_FOREIGN_KEY = 1ULL << 23
static

◆ DROP_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::DROP_INDEX = 1ULL << 1
static

◆ DROP_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::DROP_PARTITION = 1ULL << 29
static

◆ DROP_PK_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::DROP_PK_INDEX = 1ULL << 5
static

◆ DROP_STORED_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::DROP_STORED_COLUMN = 1ULL << 10
static

◆ DROP_UNIQUE_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::DROP_UNIQUE_INDEX = 1ULL << 3
static

◆ DROP_VIRTUAL_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::DROP_VIRTUAL_COLUMN = 1ULL << 9
static

◆ error_if_not_empty

bool Alter_inplace_info::error_if_not_empty

Indicates whether operation should fail if table is non-empty.

Storage engines should not suggest/allow execution of such operations using INSTANT algorithm since check whether table is empty done from SQL-layer is not "instant". Also SEs might choose different algorithm for ALTER TABLE execution knowing that it will be allowed to proceed only if table is empty.

Unlike for Alter_table_ctx::error_if_not_empty, we use bool for this flag and not bitmap, since SEs are really interested in the fact that ALTER will fail if table is not empty and not in exact reason behind this fact, and because we want to avoid extra dependency between Alter_table_ctx and Alter_inplace_info.

◆ group_commit_ctx

inplace_alter_handler_ctx** Alter_inplace_info::group_commit_ctx

If the table uses several handlers, like ha_partition uses one handler per partition, this contains a Null terminated array of ctx pointers that should all be committed together.

Or NULL if only handler_ctx should be committed. Set to NULL if the low level handler::commit_inplace_alter_table uses it, to signal to the main handler that everything was committed as atomically.

See also
inplace_alter_handler_ctx for information about object lifecycle.

◆ handler_ctx

inplace_alter_handler_ctx* Alter_inplace_info::handler_ctx

Context information to allow handlers to keep context between in-place alter API calls.

See also
inplace_alter_handler_ctx for information about object lifecycle.

◆ handler_flags

HA_ALTER_FLAGS Alter_inplace_info::handler_flags

Flags describing in detail which operations the storage engine is to execute.

◆ handler_trivial_ctx

uint Alter_inplace_info::handler_trivial_ctx

Can be set by handler along with handler_ctx.

The difference is that this flag can be used to store SE-specific in-place ALTER context in cases when constructing full-blown inplace_alter_handler_ctx descendant is inconvenient.

◆ index_add_buffer

uint* Alter_inplace_info::index_add_buffer

Array of indexes into key_info_buffer for KEYs to be added, sorted in increasing order.

◆ index_add_count

uint Alter_inplace_info::index_add_count

Size of index_add_buffer array.

◆ index_altered_visibility_buffer

KEY_PAIR* Alter_inplace_info::index_altered_visibility_buffer

◆ index_altered_visibility_count

uint Alter_inplace_info::index_altered_visibility_count

Size of index_rename_buffer array.

◆ index_drop_buffer

KEY** Alter_inplace_info::index_drop_buffer

Array of pointers to KEYs to be dropped belonging to the TABLE instance for the old version of the table.

◆ index_drop_count

uint Alter_inplace_info::index_drop_count

Size of index_drop_buffer array.

◆ index_rename_buffer

KEY_PAIR* Alter_inplace_info::index_rename_buffer

Array of KEY_PAIR objects describing indexes being renamed.

For each index renamed it contains object with KEY_PAIR::old_key pointing to KEY object belonging to the TABLE instance for old version of table representing old version of index and with KEY_PAIR::new_key pointing to KEY object for new version of index in key_info_buffer member.

◆ index_rename_count

uint Alter_inplace_info::index_rename_count

Size of index_rename_buffer array.

◆ key_count

uint Alter_inplace_info::key_count

Size of key_info_buffer array.

◆ key_info_buffer

KEY* Alter_inplace_info::key_info_buffer

Array of KEYs for new version of table - including KEYs to be added.

Note
Currently this array is produced as result of mysql_prepare_create_table() call. This means that it follows different convention for KEY_PART_INFO::fieldnr values than objects in TABLE::key_info array.

KEYs are sorted - see sort_keys().

◆ modified_part_info

partition_info* Alter_inplace_info::modified_part_info

Partition_info taking into account the partition changes to be performed.

Contains all partitions which are present in the old version of the table with partitions to be dropped or changed marked as such + all partitions to be added in the new version of table marked as such.

◆ online

bool Alter_inplace_info::online

true for online operation (LOCK=NONE)

◆ RECREATE_TABLE

const HA_ALTER_FLAGS Alter_inplace_info::RECREATE_TABLE = 1ULL << 37
static

Recreate the table for ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE operations.

◆ RENAME_INDEX

const HA_ALTER_FLAGS Alter_inplace_info::RENAME_INDEX = 1ULL << 36
static

Rename index.

Note that we set this flag only if there are no other changes to the index being renamed. Also for simplicity we don't detect renaming of indexes which is done by dropping index and then re-creating index with identical definition under different name.

◆ REORGANIZE_PARTITION

const HA_ALTER_FLAGS Alter_inplace_info::REORGANIZE_PARTITION = 1ULL << 32
static

◆ STORED_GCOL_REEVAL

const HA_ALTER_FLAGS Alter_inplace_info::STORED_GCOL_REEVAL = 1ULL << 45
static

Change to one of columns on which stored generated column depends, so its values require re-evaluation.

◆ SUSPEND_CHECK_CONSTRAINT

const HA_ALTER_FLAGS Alter_inplace_info::SUSPEND_CHECK_CONSTRAINT = 1ULL << 48
static

◆ unsupported_reason

const char* Alter_inplace_info::unsupported_reason

Can be set by handler to describe why a given operation cannot be done in-place (HA_ALTER_INPLACE_NOT_SUPPORTED) or why it cannot be done online (HA_ALTER_INPLACE_NO_LOCK or HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE) If set, it will be used with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON if results from handler::check_if_supported_inplace_alter() doesn't match requirements set by user.

If not set, the more generic ER_ALTER_OPERATION_NOT_SUPPORTED will be used.

Please set to a properly localized string, for example using my_get_err_msg(), so that the error message as a whole is localized.

◆ VALIDATE_VIRTUAL_COLUMN

const HA_ALTER_FLAGS Alter_inplace_info::VALIDATE_VIRTUAL_COLUMN = 1ULL << 40
static

◆ virtual_column_add_count

uint Alter_inplace_info::virtual_column_add_count

Number of virtual columns to be added.

◆ virtual_column_drop_count

uint Alter_inplace_info::virtual_column_drop_count

number of virtual columns to be dropped.

◆ VIRTUAL_GCOL_REEVAL

const HA_ALTER_FLAGS Alter_inplace_info::VIRTUAL_GCOL_REEVAL = 1ULL << 44
static

Change to one of columns on which virtual generated column depends, so its values require re-evaluation.


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