summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/gluh.(none)>2006-07-25 17:23:25 +0500
committerunknown <gluh@mysql.com/gluh.(none)>2006-07-25 17:23:25 +0500
commit9955388a459cf976796372633497c783eafdf48b (patch)
treed9933578d1cbee2ab94159c8d1ab7352a08775ab /sql/sql_view.cc
parent313253190ff270f17226b40bf30f7f46089458c2 (diff)
downloadmariadb-git-9955388a459cf976796372633497c783eafdf48b.tar.gz
Bug#20543 select on information_schema strange warnings, view, different schemas/users
The fix is: if user has privileges to view fields and user has any (insert,select,delete,update) privileges on underlying view then 'show fields' and select from I_S.COLUMNS table are sucsessful. mysql-test/r/information_schema_db.result: Bug#20543 select on information_schema strange warnings, view, different schemas/users test result mysql-test/t/information_schema_db.test: Bug#20543 select on information_schema strange warnings, view, different schemas/users test case sql/sql_acl.cc: Bug#20543 select on information_schema strange warnings, view, different schemas/users checked that user has privileges on underlying view and if it's true set allowed_show to true for top view. sql/sql_show.cc: Bug#20543 select on information_schema strange warnings, view, different schemas/users removed unnecessary rights check.'tables->allowed_show' check is used instead sql/sql_view.cc: Bug#20543 select on information_schema strange warnings, view, different schemas/users skip the check of SHOW_VIEW_ACL privilege on underlying view. It is done later during execution of find_field_in_table_ref function. sql/table.h: Bug#20543 select on information_schema strange warnings, view, different schemas/users 'allowed_show' is set during rights check for view. If true then user has privileges for 'show create view', etc
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 1561ade78af..90a6cba53f4 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -934,7 +934,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
}
}
else if (!table->prelocking_placeholder &&
- old_lex->sql_command == SQLCOM_SHOW_CREATE)
+ old_lex->sql_command == SQLCOM_SHOW_CREATE &&
+ !table->belong_to_view)
{
if (check_table_access(thd, SHOW_VIEW_ACL, table, 0))
goto err;