1#ifndef SQL_TRIGGER_INCLUDED
2#define SQL_TRIGGER_INCLUDED
76 bool continue_if_not_exist,
Table_ref **table);
99 const char *new_db_name);
131 const char *trg_name);
145 const char *trg_name) {
158#ifdef HAVE_PSI_SP_INTERFACE
A granted metadata lock.
Definition: mdl.h:984
This class implements the CREATE TRIGGER statement.
Definition: sql_trigger.h:201
bool execute(THD *thd) final
Execute CREATE TRIGGER statement.
Definition: sql_trigger.cc:366
enum_sql_command sql_command_code() const final
Return the command code for CREATE TRIGGER.
Definition: sql_trigger.h:207
This class has common code for CREATE/DROP TRIGGER statements.
Definition: sql_trigger.h:168
Table_ref * m_trigger_table
Definition: sql_trigger.h:194
bool check_trg_priv_on_subj_table(THD *thd, Table_ref *table) const
Check that the user has TRIGGER privilege on the subject table.
Definition: sql_trigger.cc:225
Sql_cmd_ddl_trigger_common()
Definition: sql_trigger.h:179
void set_table(Table_ref *trigger_table)
Set a table associated with a trigger.
Definition: sql_trigger.h:176
void restore_original_mdl_state(THD *thd, MDL_ticket *mdl_ticket) const
Restore original state of meta-data locks.
Definition: sql_trigger.cc:335
TABLE * open_and_lock_subj_table(THD *thd, Table_ref *tables, MDL_ticket **mdl_ticket) const
Open and lock a table associated with a trigger.
Definition: sql_trigger.cc:248
This class implements the DROP TRIGGER statement.
Definition: sql_trigger.h:218
bool execute(THD *thd) final
Execute DROP TRIGGER statement.
Definition: sql_trigger.cc:496
enum_sql_command sql_command_code() const final
Return the command code for DROP TRIGGER.
Definition: sql_trigger.h:224
Representation of an SQL command.
Definition: sql_cmd.h:65
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_CREATE_TRIGGER
Definition: my_sqlcommand.h:151
@ SQLCOM_DROP_TRIGGER
Definition: my_sqlcommand.h:152
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
const char * db_name
Definition: rules_table_service.cc:55
Representation of an SQL command.
enum_mdl_type
Type of metadata lock request.
Definition: sql_lexer_yacc_state.h:106
@ MDL_SHARED_HIGH_PRIO
Definition: sql_lexer_yacc_state.h:158
bool acquire_exclusive_mdl_for_trigger(THD *thd, const char *db, const char *trg_name)
Acquire exclusive MDL lock for a trigger in specified schema.
Definition: sql_trigger.cc:176
bool acquire_mdl_for_trigger(THD *thd, const char *db, const char *trg_name, enum_mdl_type trigger_name_mdl_type)
Acquire either exclusive or shared MDL lock for a trigger in specified schema.
Definition: sql_trigger.cc:186
bool acquire_shared_mdl_for_trigger(THD *thd, const char *db, const char *trg_name)
Acquire shared MDL lock for a trigger in specified schema.
Definition: sql_trigger.h:144
void remove_all_triggers_from_perfschema(const char *schema_name, const dd::Table &table)
Drop statistics from performance schema for every trigger associated with a table.
Definition: sql_trigger.cc:148
bool check_table_triggers_are_not_in_the_same_schema(const char *db_name, const dd::Table &table, const char *new_db_name)
Check for table with triggers that old database name and new database name are the same.
Definition: sql_trigger.cc:158
bool get_table_for_trigger(THD *thd, const LEX_CSTRING &db_name, const LEX_STRING &trigger_name, bool continue_if_not_exist, Table_ref **table)
Find trigger's table from trigger identifier.
Definition: sql_trigger.cc:79
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35