MySQL 9.1.0
Source Code Documentation
Alter_table_ctx Class Reference

Runtime context for ALTER TABLE. More...

#include <sql_alter.h>

Public Types

typedef uint error_if_not_empty_mask
 

Public Member Functions

 Alter_table_ctx ()
 
 Alter_table_ctx (THD *thd, Table_ref *table_list, uint tables_opened_arg, const char *new_db_arg, const char *new_name_arg)
 
 ~Alter_table_ctx ()
 
bool is_database_changed () const
 
bool is_table_name_changed () const
 
bool is_table_renamed () const
 
const char * get_path () const
 
const char * get_tmp_path () const
 

Public Attributes

Create_fielddatetime_field
 
error_if_not_empty_mask error_if_not_empty
 
uint tables_opened
 
const char * db
 
const char * table_name
 
const char * alias
 
const char * new_db
 
const char * new_name
 
const char * new_alias
 
char tmp_name [80]
 
FOREIGN_KEYfk_info
 
uint fk_count
 
uint fk_max_generated_name_number
 Maximum number component used by generated foreign key names in the old version of table. More...
 
MDL_request target_mdl_request
 Metadata lock request on table's new name when this name or database are changed. More...
 
MDL_request target_db_mdl_request
 Metadata lock request on table's new database if it is changed. More...
 

Static Public Attributes

static const error_if_not_empty_mask DATETIME_WITHOUT_DEFAULT = 1 << 0
 
static const error_if_not_empty_mask GEOMETRY_WITHOUT_DEFAULT = 1 << 1
 

Private Member Functions

Alter_table_ctxoperator= (const Alter_table_ctx &rhs)
 
 Alter_table_ctx (const Alter_table_ctx &rhs)
 

Private Attributes

char new_filename [FN_REFLEN+1]
 
char new_alias_buff [FN_REFLEN+1]
 
char path [FN_REFLEN+1]
 
char new_path [FN_REFLEN+1]
 
char tmp_path [FN_REFLEN+1]
 
bool tmp_table
 Indicates that we are altering temporary table. More...
 

Detailed Description

Runtime context for ALTER TABLE.

Member Typedef Documentation

◆ error_if_not_empty_mask

Constructor & Destructor Documentation

◆ Alter_table_ctx() [1/3]

Alter_table_ctx::Alter_table_ctx ( )

◆ Alter_table_ctx() [2/3]

Alter_table_ctx::Alter_table_ctx ( THD thd,
Table_ref table_list,
uint  tables_opened_arg,
const char *  new_db_arg,
const char *  new_name_arg 
)

◆ ~Alter_table_ctx()

Alter_table_ctx::~Alter_table_ctx ( )
default

◆ Alter_table_ctx() [3/3]

Alter_table_ctx::Alter_table_ctx ( const Alter_table_ctx rhs)
private

Member Function Documentation

◆ get_path()

const char * Alter_table_ctx::get_path ( ) const
inline
Returns
path to the original table.

◆ get_tmp_path()

const char * Alter_table_ctx::get_tmp_path ( ) const
inline
Returns
path to the temporary table created during ALTER TABLE.

◆ is_database_changed()

bool Alter_table_ctx::is_database_changed ( ) const
inline
Returns
true if the table is moved to another database, false otherwise.

◆ is_table_name_changed()

bool Alter_table_ctx::is_table_name_changed ( ) const
inline
Returns
true if the table name is changed, false otherwise.

◆ is_table_renamed()

bool Alter_table_ctx::is_table_renamed ( ) const
inline
Returns
true if the table is renamed (i.e. its name or database changed), false otherwise.

◆ operator=()

Alter_table_ctx & Alter_table_ctx::operator= ( const Alter_table_ctx rhs)
private

Member Data Documentation

◆ alias

const char* Alter_table_ctx::alias

◆ datetime_field

Create_field* Alter_table_ctx::datetime_field

◆ DATETIME_WITHOUT_DEFAULT

const error_if_not_empty_mask Alter_table_ctx::DATETIME_WITHOUT_DEFAULT = 1 << 0
static

◆ db

const char* Alter_table_ctx::db

◆ error_if_not_empty

error_if_not_empty_mask Alter_table_ctx::error_if_not_empty

◆ fk_count

uint Alter_table_ctx::fk_count

◆ fk_info

FOREIGN_KEY* Alter_table_ctx::fk_info

◆ fk_max_generated_name_number

uint Alter_table_ctx::fk_max_generated_name_number

Maximum number component used by generated foreign key names in the old version of table.

◆ GEOMETRY_WITHOUT_DEFAULT

const error_if_not_empty_mask Alter_table_ctx::GEOMETRY_WITHOUT_DEFAULT = 1 << 1
static

◆ new_alias

const char* Alter_table_ctx::new_alias

◆ new_alias_buff

char Alter_table_ctx::new_alias_buff[FN_REFLEN+1]
private

◆ new_db

const char* Alter_table_ctx::new_db

◆ new_filename

char Alter_table_ctx::new_filename[FN_REFLEN+1]
private

◆ new_name

const char* Alter_table_ctx::new_name

◆ new_path

char Alter_table_ctx::new_path[FN_REFLEN+1]
private

◆ path

char Alter_table_ctx::path[FN_REFLEN+1]
private

◆ table_name

const char* Alter_table_ctx::table_name

◆ tables_opened

uint Alter_table_ctx::tables_opened

◆ target_db_mdl_request

MDL_request Alter_table_ctx::target_db_mdl_request

Metadata lock request on table's new database if it is changed.

◆ target_mdl_request

MDL_request Alter_table_ctx::target_mdl_request

Metadata lock request on table's new name when this name or database are changed.

◆ tmp_name

char Alter_table_ctx::tmp_name[80]

◆ tmp_path

char Alter_table_ctx::tmp_path[FN_REFLEN+1]
private

◆ tmp_table

bool Alter_table_ctx::tmp_table
private

Indicates that we are altering temporary table.

Used only in asserts.


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