summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.h
diff options
context:
space:
mode:
authoranozdrin@mysql.com <>2006-01-24 20:15:12 +0300
committeranozdrin@mysql.com <>2006-01-24 20:15:12 +0300
commit378147a23d2744f71fbfb677021c5901c811d156 (patch)
tree8b864c683f6cc00900b0bf9a6b84bc78cb1cf3e8 /sql/sql_trigger.h
parentcf6becdebe856c27cb45e85615fb8d3a94d757c9 (diff)
downloadmariadb-git-378147a23d2744f71fbfb677021c5901c811d156.tar.gz
Fix for the following bugs:
- BUG#15166: Wrong update permissions required to execute triggers - BUG#15196: Wrong select permission required to execute triggers The idea of the fix is to check necessary privileges in Item_trigger_field::fix_fields(), instead of having "special variables" technique. To achieve this, we should pass to an Item_trigger_field instance a flag, which will indicate the usage/access type of this trigger variable.
Diffstat (limited to 'sql/sql_trigger.h')
-rw-r--r--sql/sql_trigger.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 51002683897..8992de63b37 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -56,10 +56,9 @@ class Table_triggers_list: public Sql_alloc
LEX_STRING sroutines_key;
/*
- is_special_var_used specifies whether trigger body contains special
- variables (NEW/OLD).
+ Grant information for each trigger (pair: subject table, trigger definer).
*/
- bool m_spec_var_used[TRG_EVENT_MAX][TRG_ACTION_MAX];
+ GRANT_INFO subject_table_grants[TRG_EVENT_MAX][TRG_ACTION_MAX];
public:
/*
@@ -78,6 +77,7 @@ public:
record1_field(0), table(table_arg)
{
bzero((char *)bodies, sizeof(bodies));
+ bzero((char *)&subject_table_grants, sizeof(subject_table_grants));
}
~Table_triggers_list();
@@ -109,11 +109,6 @@ public:
return test(bodies[TRG_EVENT_UPDATE][TRG_ACTION_BEFORE]);
}
- inline bool is_special_var_used(int event, int action_time) const
- {
- return m_spec_var_used[event][action_time];
- }
-
void set_table(TABLE *new_table);
friend class Item_trigger_field;