diff options
author | Martin Hansson <martin.hansson@sun.com> | 2009-09-28 13:25:47 +0200 |
---|---|---|
committer | Martin Hansson <martin.hansson@sun.com> | 2009-09-28 13:25:47 +0200 |
commit | 4b17ef621fcf02721d08c2e14437937a6b844b57 (patch) | |
tree | 5e183973a70bf08f6abae39dc182fcecd2bedeb2 /sql/sql_acl.cc | |
parent | 90d4b21d1d8418d4e6180cddbebd90daeea5b02d (diff) | |
download | mariadb-git-4b17ef621fcf02721d08c2e14437937a6b844b57.tar.gz |
Bug#35996: SELECT + SHOW VIEW should be enough to display
view definition
During SHOW CREATE VIEW there is no reason to 'anonymize'
errors that name objects that a user does not have access
to. Moreover it was inconsistently implemented. For example
base tables being referenced from a view appear to be ok,
but not views. The manual on the other hand is clear: If a
user has the privileges SELECT and SHOW VIEW, the view
definition is available to that user, period. The fix
changes the behavior to support the manual.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ab18a2d1d04..d7d662f912d 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -4072,8 +4072,7 @@ bool check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref, db_name= table_ref->view_db.str; table_name= table_ref->view_name.str; if (table_ref->belong_to_view && - (thd->lex->sql_command == SQLCOM_SHOW_FIELDS || - thd->lex->sql_command == SQLCOM_SHOW_CREATE)) + thd->lex->sql_command == SQLCOM_SHOW_FIELDS) { view_privs= get_column_grant(thd, grant, db_name, table_name, name); if (view_privs & VIEW_ANY_ACL) |