summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2015-03-04 12:20:10 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2015-03-10 14:11:02 +0200
commit0ed57e34c76ffa5e457e1abb402ada6352fb52b2 (patch)
tree60996746ea8a4b783a6dd55ed9c7e0aae0e68a25 /sql/sql_view.cc
parentc8035da9b8d037b43c27268b37df40e587780bec (diff)
downloadmariadb-git-0ed57e34c76ffa5e457e1abb402ada6352fb52b2.tar.gz
MDEV-7025 ANALYZE SELECT/INSERT/UPDATE/DELETE from a view does not check access permissions on the view
Added access checking for the ANALYZE statement command.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index a3d2b1bc4ac..d5f19677d9d 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1292,11 +1292,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
Security_context *security_ctx= 0;
/*
- Check rights to run commands (EXPLAIN SELECT & SHOW CREATE) which show
- underlying tables.
+ Check rights to run commands (ANALYZE SELECT, EXPLAIN SELECT &
+ SHOW CREATE) which show underlying tables.
Skip this step if we are opening view for prelocking only.
*/
- if (!table->prelocking_placeholder && (old_lex->describe))
+ if (!table->prelocking_placeholder && (old_lex->describe ||
+ old_lex->analyze_stmt))
{
/*
The user we run EXPLAIN as (either the connected user who issued