My Project
|
#include <handler.h>
Public Types | |
typedef ulong | HA_ALTER_FLAGS |
Public Member Functions | |
Alter_inplace_info (HA_CREATE_INFO *create_info_arg, Alter_info *alter_info_arg, KEY *key_info_arg, uint key_count_arg, partition_info *modified_part_info_arg, bool ignore_arg) | |
void | report_unsupported_error (const char *not_supported, const char *try_instead) |
Public Attributes | |
HA_CREATE_INFO * | create_info |
Alter_info * | alter_info |
KEY * | key_info_buffer |
uint | key_count |
uint | index_drop_count |
KEY ** | index_drop_buffer |
uint | index_add_count |
uint * | index_add_buffer |
inplace_alter_handler_ctx * | handler_ctx |
inplace_alter_handler_ctx ** | group_commit_ctx |
HA_ALTER_FLAGS | handler_flags |
partition_info * | modified_part_info |
const bool | ignore |
bool | online |
const char * | unsupported_reason |
Static Public Attributes | |
static const HA_ALTER_FLAGS | ADD_INDEX = 1L << 0 |
static const HA_ALTER_FLAGS | DROP_INDEX = 1L << 1 |
static const HA_ALTER_FLAGS | ADD_UNIQUE_INDEX = 1L << 2 |
static const HA_ALTER_FLAGS | DROP_UNIQUE_INDEX = 1L << 3 |
static const HA_ALTER_FLAGS | ADD_PK_INDEX = 1L << 4 |
static const HA_ALTER_FLAGS | DROP_PK_INDEX = 1L << 5 |
static const HA_ALTER_FLAGS | ADD_COLUMN = 1L << 6 |
static const HA_ALTER_FLAGS | DROP_COLUMN = 1L << 7 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_NAME = 1L << 8 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_TYPE = 1L << 9 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_EQUAL_PACK_LENGTH = 1L << 10 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_ORDER = 1L << 11 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_NULLABLE = 1L << 12 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_NOT_NULLABLE = 1L << 13 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_DEFAULT = 1L << 14 |
static const HA_ALTER_FLAGS | ADD_FOREIGN_KEY = 1L << 15 |
static const HA_ALTER_FLAGS | DROP_FOREIGN_KEY = 1L << 16 |
static const HA_ALTER_FLAGS | CHANGE_CREATE_OPTION = 1L << 17 |
static const HA_ALTER_FLAGS | ALTER_RENAME = 1L << 18 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_STORAGE_TYPE = 1L << 19 |
static const HA_ALTER_FLAGS | ALTER_COLUMN_COLUMN_FORMAT = 1L << 20 |
static const HA_ALTER_FLAGS | ADD_PARTITION = 1L << 21 |
static const HA_ALTER_FLAGS | DROP_PARTITION = 1L << 22 |
static const HA_ALTER_FLAGS | ALTER_PARTITION = 1L << 23 |
static const HA_ALTER_FLAGS | COALESCE_PARTITION = 1L << 24 |
static const HA_ALTER_FLAGS | REORGANIZE_PARTITION = 1L << 25 |
static const HA_ALTER_FLAGS | ALTER_TABLE_REORG = 1L << 26 |
static const HA_ALTER_FLAGS | ALTER_REMOVE_PARTITIONING = 1L << 27 |
static const HA_ALTER_FLAGS | ALTER_ALL_PARTITION = 1L << 28 |
static const HA_ALTER_FLAGS | RECREATE_TABLE = 1L << 29 |
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.
typedef ulong Alter_inplace_info::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.
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.
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.
not_supported | Part of statement that was not supported. |
try_instead | Suggestion as to what the user should replace not_supported with. |
const HA_ALTER_FLAGS Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH = 1L << 10 [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 options, fields and keys for the new version of table.
Create options (like MAX_ROWS) for the new version of table.
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.
Context information to allow handlers to keep context between in-place alter API calls.
Flags describing in detail which operations the storage engine is to execute.
const bool Alter_inplace_info::ignore |
true for ALTER IGNORE TABLE ...
Array of indexes into key_info_buffer for KEYs to be added, sorted in increasing order.
Size of index_add_buffer array.
Array of pointers to KEYs to be dropped belonging to the TABLE instance for the old version of the table.
Size of index_drop_buffer array.
Size of key_info_buffer array.
Array of KEYs for new version of table - including KEYs to be added.
KEYs are sorted - see sort_keys().
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.
true for online operation (LOCK=NONE)
const HA_ALTER_FLAGS Alter_inplace_info::RECREATE_TABLE = 1L << 29 [static] |
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.