diff options
author | unknown <kostja@bodhi.local> | 2006-11-30 03:34:10 +0300 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2006-11-30 03:34:10 +0300 |
commit | 6949b04246beb07f03f9e5b16e45a54b12d453a8 (patch) | |
tree | 300eb2dcf74ea58e402ef95476270467f461d204 | |
parent | 21fdaf5e8355e3dbe46cdf6c05b37f9f64df445c (diff) | |
download | mariadb-git-6949b04246beb07f03f9e5b16e45a54b12d453a8.tar.gz |
A post-merge fix: fix the failing trigger-grant.test.
sql/sql_trigger.cc:
Another post-merge fix: make TRIGGER privilege work again, after
IF EXISTS refactoring.
-rw-r--r-- | sql/sql_trigger.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index df648c49c09..e835de4dedd 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -200,22 +200,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) } /* - Check that the user has TRIGGER privilege on the subject table. - */ - { - bool err_status; - TABLE_LIST **save_query_tables_own_last= thd->lex->query_tables_own_last; - thd->lex->query_tables_own_last= 0; - - err_status= check_table_access(thd, TRIGGER_ACL, tables, 0); - - thd->lex->query_tables_own_last= save_query_tables_own_last; - - if (err_status) - DBUG_RETURN(TRUE); - } - - /* There is no DETERMINISTIC clause for triggers, so can't check it. But a trigger can in theory be used to do nasty things (if it supported DROP for example) so we do the check for privileges. For now there is @@ -268,6 +252,22 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) } } + /* + Check that the user has TRIGGER privilege on the subject table. + */ + { + bool err_status; + TABLE_LIST **save_query_tables_own_last= thd->lex->query_tables_own_last; + thd->lex->query_tables_own_last= 0; + + err_status= check_table_access(thd, TRIGGER_ACL, tables, 0); + + thd->lex->query_tables_own_last= save_query_tables_own_last; + + if (err_status) + goto end; + } + /* We should have only one table in table list. */ DBUG_ASSERT(tables->next_global == 0); |