diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-08-31 13:59:51 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-08-31 13:59:51 +0400 |
commit | 587f776cfe8cf70771cf0923199a25de710df6c4 (patch) | |
tree | a072bd6416c37d119f34bf4c471bda7898a34bc5 /sql/sql_alter.cc | |
parent | bc834b7b11e0e50ffb15996869fb2761cb149aed (diff) | |
download | mariadb-git-587f776cfe8cf70771cf0923199a25de710df6c4.tar.gz |
Remove check_merge_table_access().
check_merge_table_access() used to do two things:
- set proper database for every merge table child;
- check SELECT | UPDATE | DELETE for merge table children.
Setting database is not needed anymore, since it's done
on the parsing stage.
Thus, check_merge_table_access() can be removed;
needed privileges can be checked using check_table_access().
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r-- | sql/sql_alter.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index 046e09b20a3..5af01523aa7 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "sql_parse.h" // check_access, - // check_merge_table_access +#include "sql_parse.h" // check_access #include "sql_table.h" // mysql_alter_table, // mysql_exchange_partition #include "sql_alter.h" @@ -60,11 +59,15 @@ bool Alter_table_statement::execute(THD *thd) check_access(thd, INSERT_ACL | CREATE_ACL, select_lex->db, &priv, NULL, /* Don't use first_tab->grant with sel_lex->db */ - 0, 0) || - check_merge_table_access(thd, first_table->db, - create_info.merge_list.first)) + 0, 0)) DBUG_RETURN(TRUE); /* purecov: inspected */ + /* If it is a merge table, check privileges for merge children. */ + if (create_info.merge_list.first && + check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL, + create_info.merge_list.first, FALSE, UINT_MAX, FALSE)) + DBUG_RETURN(TRUE); + if (check_grant(thd, priv_needed, first_table, FALSE, UINT_MAX, FALSE)) DBUG_RETURN(TRUE); /* purecov: inspected */ |