diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-02-03 16:43:03 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-02-03 16:43:03 +0300 |
commit | c8555bdb35d998e99b6fb568f03c63479ff9272d (patch) | |
tree | 3b69ab5126c40ef71ad69a5bb469de82c4be90a0 /sql/sql_view.cc | |
parent | 962d77de368e0cc90431e24d09e884f3760c7939 (diff) | |
parent | 3d915225611a921fad03934e58bf281b48fc15b0 (diff) | |
download | mariadb-git-c8555bdb35d998e99b6fb568f03c63479ff9272d.tar.gz |
Merge next-mr -> next-4284
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 787b11b204f..84418d6b629 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -235,12 +235,16 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, checked that we have not more privileges on correspondent column of view table (i.e. user will not get some privileges by view creation) */ - if ((check_access(thd, CREATE_VIEW_ACL, view->db, &view->grant.privilege, - 0, 0, is_schema_db(view->db)) || + if ((check_access(thd, CREATE_VIEW_ACL, view->db, + &view->grant.privilege, + &view->grant.m_internal, + 0, 0) || check_grant(thd, CREATE_VIEW_ACL, view, FALSE, 1, FALSE)) || (mode != VIEW_CREATE_NEW && - (check_access(thd, DROP_ACL, view->db, &view->grant.privilege, - 0, 0, is_schema_db(view->db)) || + (check_access(thd, DROP_ACL, view->db, + &view->grant.privilege, + &view->grant.m_internal, + 0, 0) || check_grant(thd, DROP_ACL, view, FALSE, 1, FALSE)))) goto err; @@ -290,7 +294,9 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, if (!tbl->table_in_first_from_clause) { if (check_access(thd, SELECT_ACL, tbl->db, - &tbl->grant.privilege, 0, 0, test(tbl->schema_table)) || + &tbl->grant.privilege, + &tbl->grant.m_internal, + 0, 0) || check_grant(thd, SELECT_ACL, tbl, FALSE, 1, FALSE)) goto err; } @@ -1636,7 +1642,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) } continue; } - if (my_delete(path, MYF(MY_WME))) + if (mysql_file_delete(key_file_frm, path, MYF(MY_WME))) error= TRUE; some_views_deleted= TRUE; @@ -1708,10 +1714,11 @@ frm_type_enum mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt) *dbt= DB_TYPE_UNKNOWN; - if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0) + if ((file= mysql_file_open(key_file_frm, + path, O_RDONLY | O_SHARE, MYF(0))) < 0) DBUG_RETURN(FRMTYPE_ERROR); - error= my_read(file, (uchar*) header, sizeof(header), MYF(MY_NABP)); - my_close(file, MYF(MY_WME)); + error= mysql_file_read(file, (uchar*) header, sizeof(header), MYF(MY_NABP)); + mysql_file_close(file, MYF(MY_WME)); if (error) DBUG_RETURN(FRMTYPE_ERROR); |