MySQL 8.4.2
Source Code Documentation
Alter_column Class Reference

Class representing SET DEFAULT, DROP DEFAULT, RENAME COLUMN, SET VISIBLE and SET INVISIBLE clause in ALTER TABLE statement. More...

#include <sql_alter.h>

Public Types

enum class  Type {
  SET_DEFAULT , DROP_DEFAULT , RENAME_COLUMN , SET_COLUMN_VISIBLE ,
  SET_COLUMN_INVISIBLE
}
 

Public Member Functions

Type change_type () const
 Type of change requested in ALTER TABLE. More...
 
 Alter_column (const char *par_name, Item *literal)
 Constructor used when altering the field's default value with a literal constant or when dropping a field's default value. More...
 
 Alter_column (const char *par_name, Value_generator *gen_def)
 Constructor used when setting a field's DEFAULT value to an expression. More...
 
 Alter_column (const char *old_name, const char *new_name)
 Constructor used while renaming field name. More...
 
 Alter_column (const char *par_name, bool par_is_visible)
 Constructor used while altering column visibility. More...
 

Public Attributes

const char * name
 The column name being altered. More...
 
Itemdef
 The default value supplied. More...
 
Value_generatorm_default_val_expr
 The expression to be used to generate the default value. More...
 
const char * m_new_name
 The new column name. More...
 

Private Attributes

Type m_type
 

Detailed Description

Class representing SET DEFAULT, DROP DEFAULT, RENAME COLUMN, SET VISIBLE and SET INVISIBLE clause in ALTER TABLE statement.

Member Enumeration Documentation

◆ Type

enum class Alter_column::Type
strong
Enumerator
SET_DEFAULT 
DROP_DEFAULT 
RENAME_COLUMN 
SET_COLUMN_VISIBLE 
SET_COLUMN_INVISIBLE 

Constructor & Destructor Documentation

◆ Alter_column() [1/4]

Alter_column::Alter_column ( const char *  par_name,
Item literal 
)
inline

Constructor used when altering the field's default value with a literal constant or when dropping a field's default value.

◆ Alter_column() [2/4]

Alter_column::Alter_column ( const char *  par_name,
Value_generator gen_def 
)
inline

Constructor used when setting a field's DEFAULT value to an expression.

◆ Alter_column() [3/4]

Alter_column::Alter_column ( const char *  old_name,
const char *  new_name 
)
inline

Constructor used while renaming field name.

◆ Alter_column() [4/4]

Alter_column::Alter_column ( const char *  par_name,
bool  par_is_visible 
)
inline

Constructor used while altering column visibility.

Member Function Documentation

◆ change_type()

Type Alter_column::change_type ( ) const
inline

Type of change requested in ALTER TABLE.

Member Data Documentation

◆ def

Item* Alter_column::def

The default value supplied.

◆ m_default_val_expr

Value_generator* Alter_column::m_default_val_expr

The expression to be used to generate the default value.

◆ m_new_name

const char* Alter_column::m_new_name

The new column name.

◆ m_type

Type Alter_column::m_type
private

◆ name

const char* Alter_column::name

The column name being altered.


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