MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Alter_info Class Reference

#include <sql_alter.h>

Collaboration diagram for Alter_info:

Public Types

enum  enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }
enum  enum_alter_table_algorithm { ALTER_TABLE_ALGORITHM_DEFAULT, ALTER_TABLE_ALGORITHM_INPLACE, ALTER_TABLE_ALGORITHM_COPY }
enum  enum_alter_table_lock { ALTER_TABLE_LOCK_DEFAULT, ALTER_TABLE_LOCK_NONE, ALTER_TABLE_LOCK_SHARED, ALTER_TABLE_LOCK_EXCLUSIVE }

Public Member Functions

void reset ()
 Alter_info (const Alter_info &rhs, MEM_ROOT *mem_root)
bool set_requested_algorithm (const LEX_STRING *str)
bool set_requested_lock (const LEX_STRING *str)

Public Attributes

List< Alter_dropdrop_list
List< Alter_columnalter_list
List< Keykey_list
List< Create_fieldcreate_list
uint flags
enum_enable_or_disable keys_onoff
List< char > partition_names
uint num_parts
enum_alter_table_algorithm requested_algorithm
enum_alter_table_lock requested_lock

Static Public Attributes

static const uint ALTER_ADD_COLUMN = 1L << 0
static const uint ALTER_DROP_COLUMN = 1L << 1
static const uint ALTER_CHANGE_COLUMN = 1L << 2
static const uint ALTER_ADD_INDEX = 1L << 3
static const uint ALTER_DROP_INDEX = 1L << 4
static const uint ALTER_RENAME = 1L << 5
static const uint ALTER_ORDER = 1L << 6
static const uint ALTER_OPTIONS = 1L << 7
static const uint ALTER_CHANGE_COLUMN_DEFAULT = 1L << 8
static const uint ALTER_KEYS_ONOFF = 1L << 9
static const uint ALTER_CONVERT = 1L << 10
static const uint ALTER_RECREATE = 1L << 11
static const uint ALTER_ADD_PARTITION = 1L << 12
static const uint ALTER_DROP_PARTITION = 1L << 13
static const uint ALTER_COALESCE_PARTITION = 1L << 14
static const uint ALTER_REORGANIZE_PARTITION = 1L << 15
static const uint ALTER_PARTITION = 1L << 16
static const uint ALTER_ADMIN_PARTITION = 1L << 17
static const uint ALTER_TABLE_REORG = 1L << 18
static const uint ALTER_REBUILD_PARTITION = 1L << 19
static const uint ALTER_ALL_PARTITION = 1L << 20
static const uint ALTER_REMOVE_PARTITIONING = 1L << 21
static const uint ADD_FOREIGN_KEY = 1L << 22
static const uint DROP_FOREIGN_KEY = 1L << 23
static const uint ALTER_EXCHANGE_PARTITION = 1L << 24
static const uint ALTER_TRUNCATE_PARTITION = 1L << 25
static const uint ALTER_COLUMN_ORDER = 1L << 26

Detailed Description

Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.

Definition at line 29 of file sql_alter.h.

Member Enumeration Documentation

The different values of the ALGORITHM clause. Describes which algorithm to use when altering the table.

Definition at line 133 of file sql_alter.h.

The different values of the LOCK clause. Describes the level of concurrency during ALTER TABLE.

Definition at line 150 of file sql_alter.h.

Constructor & Destructor Documentation

Alter_info::Alter_info ( const Alter_info rhs,
MEM_ROOT mem_root 
)

Construct a copy of this object to be used for mysql_alter_table and mysql_create_table.

Historically, these two functions modify their Alter_info arguments. This behaviour breaks re-execution of prepared statements and stored procedures and is compensated by always supplying a copy of Alter_info to these functions.

Parameters
rhsAlter_info to make copy of
mem_rootMem_root for new Alter_info
Note
You need to use check the error in THD for out of memory condition after calling this function.

Definition at line 23 of file sql_alter.cc.

Member Function Documentation

bool Alter_info::set_requested_algorithm ( const LEX_STRING str)

Parses the given string and sets requested_algorithm if the string value matches a supported value. Supported values: INPLACE, COPY, DEFAULT

Parameters
strString containing the supplied value
Return values
falseSupported value found, state updated
trueNot supported value, no changes made

Definition at line 52 of file sql_alter.cc.

bool Alter_info::set_requested_lock ( const LEX_STRING str)

Parses the given string and sets requested_lock if the string value matches a supported value. Supported values: NONE, SHARED, EXCLUSIVE, DEFAULT

Parameters
strString containing the supplied value
Return values
falseSupported value found, state updated
trueNot supported value, no changes made

Definition at line 67 of file sql_alter.cc.


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