24#ifndef SQL_CHECK_CONSTRAINT_INCLUDED
25#define SQL_CHECK_CONSTRAINT_INCLUDED
215 const char *column_name);
Class representing SET DEFAULT, DROP DEFAULT, RENAME COLUMN, SET VISIBLE and SET INVISIBLE clause in ...
Definition: sql_alter.h:81
Class representing DROP COLUMN, DROP KEY, DROP FOREIGN KEY, DROP CHECK CONSTRAINT and DROP CONSTRAINT...
Definition: sql_alter.h:64
Helper class to check if column being dropped or removed in ALTER statement is in use by Check constr...
Definition: sql_check_constraint.h:221
const Sql_check_constraint_spec_list & m_check_constraint_list
Check constraint specification list.
Definition: sql_check_constraint.h:272
bool operator()(const Alter_drop *drop)
Method to check if column being dropped is in use by check constraints.
Definition: sql_check_constraint.cc:147
Check_constraint_column_dependency_checker(const Sql_check_constraint_spec_list &check_constraint_list)
Definition: sql_check_constraint.h:223
bool any_check_constraint_uses_column(const char *column_name)
Check if any check constraint uses "column_name".
Definition: sql_check_constraint.cc:132
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
Class to represent check constraint in the TABLE_SHARE.
Definition: sql_check_constraint.h:110
bool m_is_enforced
Check constraint state.
Definition: sql_check_constraint.h:133
bool is_enforced()
Check constraint state (enforced / not enforced)
Definition: sql_check_constraint.h:123
Sql_check_constraint_share(const LEX_CSTRING &name, const LEX_CSTRING &expr_str, bool is_enforced)
Definition: sql_check_constraint.h:114
LEX_CSTRING m_name
Check constraint name.
Definition: sql_check_constraint.h:127
Sql_check_constraint_share()=default
LEX_CSTRING & name()
Constraint name.
Definition: sql_check_constraint.h:119
LEX_CSTRING & expr_str()
Check expression in string form.
Definition: sql_check_constraint.h:121
LEX_CSTRING m_expr_str
Check constraint expression.
Definition: sql_check_constraint.h:130
Class to represent the check constraint specifications obtained from the SQL statement parse.
Definition: sql_check_constraint.h:43
bool is_alter_mode
During ALTER TABLE operation, the state of the Sql_check_constraint_spec instance(s) is set to alter ...
Definition: sql_check_constraint.h:96
LEX_STRING alias_name
Alias name for check constraints.
Definition: sql_check_constraint.h:99
Item * check_expr
Check constraint expression.
Definition: sql_check_constraint.h:80
bool expr_refers_column(const char *column_name)
Method to check if column "column_name" referred in the check constraint expression.
Definition: sql_check_constraint.cc:93
void print_expr(THD *thd, String &out)
Write check constraint expression into a String with proper syntax.
Definition: sql_check_constraint.cc:86
LEX_STRING column_name
Name of the column if check clause is defined at the column level.
Definition: sql_check_constraint.h:83
bool pre_validate()
Validate check constraint name, perform per item-type to check if the expression is allowed for the c...
Definition: sql_check_constraint.cc:45
bool is_enforced
Check constraint state (enforced/not enforced)
Definition: sql_check_constraint.h:86
LEX_STRING name
Name of the check constraint.
Definition: sql_check_constraint.h:77
Class to represent check constraint in the TABLE instance.
Definition: sql_check_constraint.h:145
TABLE * m_table
Parent table reference.
Definition: sql_check_constraint.h:168
Sql_table_check_constraint(const LEX_CSTRING &name, const LEX_CSTRING &expr_str, bool is_enforced, Value_generator *val_gen, TABLE *table)
Definition: sql_check_constraint.h:149
Value_generator * m_val_gen
Value generator for the check constraint expression.
Definition: sql_check_constraint.h:165
Value_generator * value_generator()
Value generator.
Definition: sql_check_constraint.h:157
TABLE * table() const
Reference to owner table.
Definition: sql_check_constraint.h:161
Sql_table_check_constraint()=default
void set_value_generator(Value_generator *val_gen)
Definition: sql_check_constraint.h:158
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:483
bool drop(THD *thd, const Table *tp)
Remove SDI for a table.
Definition: sdi.cc:639
bool check_constraint_expr_refers_to_only_column(Item *check_expr, const char *column_name)
Check if constraint expression refers to only "column_name" column of the table.
Definition: sql_check_constraint.cc:113
bool is_slave_with_master_without_check_constraints_support(THD *thd)
Method to check if server is a slave server and master server is on a version not supporting check co...
Definition: sql_check_constraint.cc:106
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35