MySQL 8.4.2
Source Code Documentation
|
Class to represent the check constraint specifications obtained from the SQL statement parse. More...
#include <sql_check_constraint.h>
Public Member Functions | |
bool | pre_validate () |
Validate check constraint name, perform per item-type to check if the expression is allowed for the check constraint. More... | |
void | print_expr (THD *thd, String &out) |
Write check constraint expression into a String with proper syntax. More... | |
bool | expr_refers_column (const char *column_name) |
Method to check if column "column_name" referred in the check constraint expression. More... | |
Public Attributes | |
LEX_STRING | name {nullptr, 0} |
Name of the check constraint. More... | |
Item * | check_expr {nullptr} |
Check constraint expression. More... | |
LEX_STRING | column_name {nullptr, 0} |
Name of the column if check clause is defined at the column level. More... | |
bool | is_enforced {true} |
Check constraint state (enforced/not enforced) More... | |
bool | is_alter_mode {false} |
During ALTER TABLE operation, the state of the Sql_check_constraint_spec instance(s) is set to alter mode in new table definition. More... | |
LEX_STRING | alias_name {nullptr, 0} |
Alias name for check constraints. More... | |
Class to represent the check constraint specifications obtained from the SQL statement parse.
bool Sql_check_constraint_spec::expr_refers_column | ( | const char * | column_name | ) |
Method to check if column "column_name" referred in the check constraint expression.
[in] | column_name | Column name. |
true | If column name is referenced in the check expression. |
false | Otherwise. |
bool Sql_check_constraint_spec::pre_validate | ( | ) |
Validate check constraint name, perform per item-type to check if the expression is allowed for the check constraint.
Check expression is pre-validated at this stage. Validation of specific functions in expression is done later in the method open_table_from_share.
false | Success. |
true | Failure. |
Write check constraint expression into a String with proper syntax.
[in] | thd | Thread handle. |
[out] | out | Check constraint expression. |
LEX_STRING Sql_check_constraint_spec::alias_name {nullptr, 0} |
Alias name for check constraints.
LEX_STRING Sql_check_constraint_spec::column_name {nullptr, 0} |
Name of the column if check clause is defined at the column level.
bool Sql_check_constraint_spec::is_alter_mode {false} |
During ALTER TABLE operation, the state of the Sql_check_constraint_spec instance(s) is set to alter mode in new table definition.
In this mode, alias_name is stored to data-dictionary tables to avoid name conflicts. The name of the check constraint is updated to actual name after older table version is either dropped or when new version of table is renamed to actual table name.
bool Sql_check_constraint_spec::is_enforced {true} |
Check constraint state (enforced/not enforced)
LEX_STRING Sql_check_constraint_spec::name {nullptr, 0} |
Name of the check constraint.