#[repr(C)]
pub struct Alter_inplace_info {
Show 24 fields pub create_info: *mut HA_CREATE_INFO, pub alter_info: *mut Alter_info, pub key_info_buffer: *mut KEY, pub key_count: uint, pub index_drop_count: uint, pub index_drop_buffer: *mut *mut KEY, pub index_add_count: uint, pub index_add_buffer: *mut uint, pub index_altered_ignorability_buffer: *mut KEY_PAIR, pub index_altered_ignorability_count: uint, pub rename_keys: Alter_inplace_info_Rename_keys_vector, pub handler_ctx: *mut inplace_alter_handler_ctx, pub group_commit_ctx: *mut *mut inplace_alter_handler_ctx, pub handler_flags: alter_table_operations, pub partition_flags: ulong, pub modified_part_info: *mut partition_info, pub ignore: bool, pub online: bool, pub inplace_alter_table_committed: Alter_inplace_info_inplace_alter_table_commit_callback, pub inplace_alter_table_committed_argument: *mut c_void, pub inplace_supported: Type, pub unsupported_reason: *const c_char, pub error_if_not_empty: bool, pub mdl_exclusive_after_prepare: bool,
}
Expand 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.

Fields§

§create_info: *mut HA_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.

§alter_info: *mut 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.

§key_info_buffer: *mut KEY

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.

@todo This is mainly due to the fact that we need to keep compatibility with removed handler::add_index() call. We plan to switch to TABLE::key_info numbering later.

KEYs are sorted - see sort_keys().

§key_count: uint

Size of key_info_buffer array.

§index_drop_count: uint

Size of index_drop_buffer array.

§index_drop_buffer: *mut *mut KEY

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

§index_add_count: uint

Size of index_add_buffer array.

§index_add_buffer: *mut uint

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

§index_altered_ignorability_buffer: *mut KEY_PAIR§index_altered_ignorability_count: uint

Size of index_altered_ignorability_buffer array.

§rename_keys: Alter_inplace_info_Rename_keys_vector

A list of indexes which should be renamed. Index definitions stays the same.

§handler_ctx: *mut inplace_alter_handler_ctx

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

@see inplace_alter_handler_ctx for information about object lifecycle.

§group_commit_ctx: *mut *mut inplace_alter_handler_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 inplace_alter_handler_ctx for information about object lifecycle.

§handler_flags: alter_table_operations

Flags describing in detail which operations the storage engine is to execute. Flags are defined in sql_alter.h

§partition_flags: ulong§modified_part_info: *mut partition_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.

§ignore: bool

true for ALTER IGNORE TABLE …

§online: bool

true for online operation (LOCK=NONE)

§inplace_alter_table_committed: Alter_inplace_info_inplace_alter_table_commit_callback§inplace_alter_table_committed_argument: *mut c_void§inplace_supported: Type

which ALGORITHM and LOCK are supported by the storage engine

§unsupported_reason: *const c_char

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_COPY_NO_LOCK) 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.

§error_if_not_empty: bool

true when InnoDB should abort the alter when table is not empty

§mdl_exclusive_after_prepare: bool

True when DDL should avoid downgrading the MDL

Implementations§

source§

impl Alter_inplace_info

source

pub unsafe fn report_unsupported_error( &self, not_supported: *const c_char, try_instead: *const c_char )

source

pub unsafe fn new( create_info_arg: *mut HA_CREATE_INFO, alter_info_arg: *mut Alter_info, key_info_arg: *mut KEY, key_count_arg: uint, modified_part_info_arg: *mut partition_info, ignore_arg: bool, error_non_empty: bool ) -> Self

Trait Implementations§

source§

impl Debug for Alter_inplace_info

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.