diff options
author | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-10-06 11:49:58 +0100 |
---|---|---|
committer | Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com> | 2011-10-06 11:49:58 +0100 |
commit | 9a0ec3cf728d91374af4db174b9e9b76864344ca (patch) | |
tree | cca14bedd0e99f82f9efd683067eeaf088114fd2 /sql/sql_view.cc | |
parent | 0581820455c9133b9bd29711b27852e82b86a8d9 (diff) | |
parent | fa8e3ce64f83345ffd0b3d1640024880423c744c (diff) | |
download | mariadb-git-9a0ec3cf728d91374af4db174b9e9b76864344ca.tar.gz |
manual merge
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 525d8b9cccc..1d26d2b113c 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1297,23 +1297,25 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, with "security_ctx" member set to 0, i.e. forcing check_table_access() to use active user's security context. - There is no need for creating similar copies of table list elements - for underlying tables since they are just have been constructed and - thus have TABLE_LIST::security_ctx == 0 and fresh TABLE_LIST::grant - member. + There is no need for creating similar copies of TABLE_LIST elements + for underlying tables since they just have been constructed and thus + have TABLE_LIST::security_ctx == 0 and fresh TABLE_LIST::grant member. Finally at this point making sure we have SHOW_VIEW_ACL on the views will suffice as we implicitly require SELECT_ACL anyway. */ - TABLE_LIST view; - bzero((char *)&view, sizeof(TABLE_LIST)); - view.db= table->db; - view.table_name= table->table_name; + TABLE_LIST view_no_suid; + bzero(static_cast<void *>(&view_no_suid), sizeof(TABLE_LIST)); + view_no_suid.db= table->db; + view_no_suid.table_name= table->table_name; + + DBUG_ASSERT(view_tables == NULL || view_tables->security_ctx == NULL); if (check_table_access(thd, SELECT_ACL, view_tables, FALSE, UINT_MAX, TRUE) || - check_table_access(thd, SHOW_VIEW_ACL, &view, FALSE, UINT_MAX, TRUE)) + check_table_access(thd, SHOW_VIEW_ACL, &view_no_suid, + FALSE, UINT_MAX, TRUE)) { my_message(ER_VIEW_NO_EXPLAIN, ER(ER_VIEW_NO_EXPLAIN), MYF(0)); goto err; |