diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-10-02 15:08:15 +0500 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-10-02 15:08:15 +0500 |
commit | 4735aaea70bc11c4658dae3a62a9c0ffb8bf9d57 (patch) | |
tree | 21d787daabf921b220be90cc624523943f10242d /sql/sql_show.cc | |
parent | 7adf7154f7c3d09dacf64872620f44d28b0a8bdc (diff) | |
parent | 7e60f71001595df62b92a089869dd67fcc15a1ee (diff) | |
download | mariadb-git-4735aaea70bc11c4658dae3a62a9c0ffb8bf9d57.tar.gz |
automerge
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cc465db7720..f715da843c2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4236,6 +4236,27 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables, !my_strcasecmp(system_charset_info, tables->definer.host.str, sctx->priv_host)) tables->allowed_show= TRUE; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + else + { + if ((thd->col_access & (SHOW_VIEW_ACL|SELECT_ACL)) == + (SHOW_VIEW_ACL|SELECT_ACL)) + tables->allowed_show= TRUE; + else + { + TABLE_LIST table_list; + uint view_access; + memset(&table_list, 0, sizeof(table_list)); + table_list.db= tables->view_db.str; + table_list.table_name= tables->view_name.str; + table_list.grant.privilege= thd->col_access; + view_access= get_table_grant(thd, &table_list); + if ((view_access & (SHOW_VIEW_ACL|SELECT_ACL)) == + (SHOW_VIEW_ACL|SELECT_ACL)) + tables->allowed_show= TRUE; + } + } +#endif } restore_record(table, s->default_values); tmp_db_name= &tables->view_db; |