This file contains declarations of global public functions which are used directly from parser/executioner to perform basic operations on triggers (CREATE TRIGGER, DROP TRIGGER, ALTER TABLE, DROP TABLE, ...)
More...
Go to the source code of this file.
|
namespace | dd |
| The version of the current data dictionary table definitions.
|
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
This file contains declarations of global public functions which are used directly from parser/executioner to perform basic operations on triggers (CREATE TRIGGER, DROP TRIGGER, ALTER TABLE, DROP TABLE, ...)
◆ acquire_exclusive_mdl_for_trigger()
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.
- Parameters
-
[in] | thd | Current thread context |
[in] | db | Schema name |
[in] | trg_name | Trigger name |
- Returns
- Operation status.
- Return values
-
◆ acquire_mdl_for_trigger()
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.
- Parameters
-
[in] | thd | Current thread context |
[in] | db | Schema name |
[in] | trg_name | Trigger name |
[in] | trigger_name_mdl_type | Type of MDL to acquire for trigger name |
- Returns
- Operation status.
- Return values
-
◆ acquire_shared_mdl_for_trigger()
bool acquire_shared_mdl_for_trigger |
( |
THD * |
thd, |
|
|
const char * |
db, |
|
|
const char * |
trg_name |
|
) |
| |
|
inline |
Acquire shared MDL lock for a trigger in specified schema.
- Parameters
-
[in] | thd | Current thread context |
[in] | db | Schema name |
[in] | trg_name | Trigger name |
- Returns
- Operation status.
- Return values
-
◆ check_table_triggers_are_not_in_the_same_schema()
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.
This functions is called while handling the statement RENAME TABLE to ensure that table moved within the same database.
- Parameters
-
[in] | db_name | Schema name. |
[in] | table | Table. |
[in] | new_db_name | New schema name |
- Note
- Set error ER_TRG_IN_WRONG_SCHEMA in Diagnostics_area in case function returns true.
- Returns
- Operation status
- Return values
-
false | Either there is no triggers assigned to a table or old and new schema name are the same. |
true | Old and new schema name aren't the same. |
◆ get_table_for_trigger()
Find trigger's table from trigger identifier.
- Parameters
-
[in] | thd | Thread context. |
[in] | db_name | Schema name. |
[in] | trigger_name | Trigger name. |
[in] | continue_if_not_exist | true if SQL statement contains "IF EXISTS" clause. That means a warning instead of error should be thrown if trigger with given name does not exist. |
[out] | table | Pointer to Table_ref object for the table trigger. |
- Returns
- Operation status
- Return values
-
false | On success. |
true | Otherwise. |
◆ remove_all_triggers_from_perfschema()
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.
- Parameters
-
schema_name | Name of schema containing the table. |
table | Table reference, for that associated triggers statistics has to be deleted. |