mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
WL#1218 "Triggers". Some very preliminary version of patch.
Mostly needed for Monty for him getting notion what needed for triggers from new .FRM format. Things to be done: - Right placement of trigger's invocations - Right handling of errors in triggers (including transaction rollback) - Support for priviliges - Right handling of DROP/RENAME table (hope that it will be handled automatically with merging of .TRG into .FRM file) - Saving/restoring some information critical for trigger creation and replication with their definitions (e.g. sql_mode, creator, ...) - Replication Already has some known bugs so probably not for general review.
This commit is contained in:
@ -85,6 +85,7 @@ enum enum_sql_command {
|
||||
SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC,
|
||||
SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE,
|
||||
SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW,
|
||||
SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
|
||||
/* This should be the last !!! */
|
||||
SQLCOM_END
|
||||
};
|
||||
@ -606,6 +607,15 @@ struct st_sp_chistics
|
||||
bool detistic;
|
||||
};
|
||||
|
||||
|
||||
struct st_trg_chistics
|
||||
{
|
||||
enum trg_action_time_type action_time;
|
||||
enum trg_event_type event;
|
||||
};
|
||||
|
||||
extern sys_var_long_ptr trg_new_row_fake_var;
|
||||
|
||||
/* The state of the lex parsing. This is saved in the THD struct */
|
||||
|
||||
typedef struct st_lex
|
||||
@ -710,6 +720,14 @@ typedef struct st_lex
|
||||
rexecuton
|
||||
*/
|
||||
bool empty_field_list_on_rset;
|
||||
/* Characterstics of trigger being created */
|
||||
st_trg_chistics trg_chistics;
|
||||
/*
|
||||
Points to table being opened when we are parsing trigger definition
|
||||
while opening table. 0 if we are parsing user provided CREATE TRIGGER
|
||||
or any other statement. Used for NEW/OLD row field lookup in trigger.
|
||||
*/
|
||||
TABLE *trg_table;
|
||||
|
||||
st_lex()
|
||||
{
|
||||
|
Reference in New Issue
Block a user