summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2010-01-13 12:22:34 +0000
committerAlfranio Correia <alfranio.correia@sun.com>2010-01-13 12:22:34 +0000
commit40949a3110a97e41d48c24e51004851521dd807b (patch)
treedddf2d3ec6941e3f9c47deefb52bcfa19ef6a23e /sql/sql_view.cc
parent26b12adb5d19fea7308edd0c2b49e1c972ea79c3 (diff)
parent51caeae915d3a5add57a785e69b7ce52cac084ad (diff)
downloadmariadb-git-40949a3110a97e41d48c24e51004851521dd807b.tar.gz
merge mysql-next-mr --> mysql-5.1-rpl-merge
Conflicts: Text conflict in sql/log.cc Text conflict in sql/slave.cc Text conflict in sql/sql_base.cc
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 84b9dd6edbf..6f824750737 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -258,12 +258,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;
@@ -313,7 +317,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;
}
@@ -1608,7 +1614,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;
@@ -1620,10 +1626,10 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
if ((share= get_cached_table_share(view->db, view->table_name)))
{
DBUG_ASSERT(share->ref_count == 0);
- pthread_mutex_lock(&share->mutex);
+ mysql_mutex_lock(&share->mutex);
share->ref_count++;
share->version= 0;
- pthread_mutex_unlock(&share->mutex);
+ mysql_mutex_unlock(&share->mutex);
release_table_share(share, RELEASE_WAIT_FOR_DROP);
}
query_cache_invalidate3(thd, view, 0);
@@ -1683,10 +1689,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);