MySQL 9.0.0
Source Code Documentation
Drop_constraint_type_resolver Class Referencefinal

Class to resolve constraints type for the constraints specified in the ALTER TABLE ... DROP CONSTRAINT operation. More...

#include <sql_constraint.h>

Inheritance diagram for Drop_constraint_type_resolver:
[legend]

Public Member Functions

 Drop_constraint_type_resolver (Alter_info *alter_info)
 
 ~Drop_constraint_type_resolver () override
 
bool is_type_resolution_needed () const override
 Method to check if constraint type resolution is needed. More...
 
bool resolve_constraints_type (THD *thd, const TABLE *src_table, const dd::Table *dd_src_table) override
 Method to resolve constraints type. More...
 
- Public Member Functions inherited from Constraint_type_resolver
 Constraint_type_resolver (Alter_info *alter_info)
 
virtual ~Constraint_type_resolver ()=default
 

Private Member Functions

bool resolve_constraint_type (THD *thd, const TABLE *src_table, const dd::Table *dd_src_table, const Alter_drop *drop)
 Method to resolve constraint type. More...
 

Private Attributes

ulonglong m_flags {0}
 Flags set in Alter_info::flags while fixing type for constraint. More...
 
uint m_first_fixed_alter_drop_pos {0}
 

Additional Inherited Members

- Protected Member Functions inherited from Constraint_type_resolver
KEYis_primary_or_unique_constraint (const TABLE *src_table, const char *name)
 Helper method to check if "name" type is PRIMARY or UNIQUE constraint. More...
 
bool is_referential_constraint (const dd::Table *dd_src_table, const char *name)
 Helper method to check if "name" type is REFERENTIAL constraint. More...
 
bool is_check_constraint (const TABLE *src_table, const char *name)
 Helper method to check if "name" type is CHECK constraint. More...
 
- Protected Attributes inherited from Constraint_type_resolver
Alter_infom_alter_info
 Alter_info instance describing table being altered. More...
 

Detailed Description

Class to resolve constraints type for the constraints specified in the ALTER TABLE ... DROP CONSTRAINT operation.

For a constraint specified in the DROP CONSTRAINT operations of a ALTER TABLE statement, actual constraint type is unknown. This is the class to resolve actual constraint type (PRIMARY, UNIQUE, FOREIGN KEY or CHECK) by constraint name. Alter_drop elements with actual constraint type are added to the Alter_info::Alter_drop list. To make changes safe for re-execution of a stored routines and prepared statements, elements added to Alter_drop list are removed in the destructor.

Constructor & Destructor Documentation

◆ Drop_constraint_type_resolver()

Drop_constraint_type_resolver::Drop_constraint_type_resolver ( Alter_info alter_info)
inlineexplicit

◆ ~Drop_constraint_type_resolver()

Drop_constraint_type_resolver::~Drop_constraint_type_resolver ( )
override

Member Function Documentation

◆ is_type_resolution_needed()

bool Drop_constraint_type_resolver::is_type_resolution_needed ( ) const
overridevirtual

Method to check if constraint type resolution is needed.

Return values
trueif ALTER TABLE statement has DROP CONSTRAINT operations.
falseOtherwise.

Implements Constraint_type_resolver.

◆ resolve_constraint_type()

bool Drop_constraint_type_resolver::resolve_constraint_type ( THD thd,
const TABLE src_table,
const dd::Table dd_src_table,
const Alter_drop drop 
)
private

Method to resolve constraint type.

Parameters
thdThread handle.
src_tableTABLE instance of a source table.
dd_src_tableData-dictionary table instance of a source table.
dropAlter_drop instance for which type should be resolved.
Return values
falseSuccess.
trueFailure.

◆ resolve_constraints_type()

bool Drop_constraint_type_resolver::resolve_constraints_type ( THD thd,
const TABLE src_table,
const dd::Table dd_src_table 
)
overridevirtual

Method to resolve constraints type.

Parameters
thdThread handle.
src_tableTABLE instance of a source table.
dd_src_tableData-dictionary table instance of a source table.
Return values
falseSuccess.
trueFailure.

Implements Constraint_type_resolver.

Member Data Documentation

◆ m_first_fixed_alter_drop_pos

uint Drop_constraint_type_resolver::m_first_fixed_alter_drop_pos {0}
private

◆ m_flags

ulonglong Drop_constraint_type_resolver::m_flags {0}
private

Flags set in Alter_info::flags while fixing type for constraint.


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