summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-17 00:16:57 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-17 00:16:57 +0300
commitf284ce04c482cb49175cbd5d9870e12cf5d08943 (patch)
tree2d5c57a247fce961fd2052829ccd78edf86573f4 /sql/sql_view.cc
parent29ec367edd81aff7b8fc4b6abbbfff5e2620be19 (diff)
downloadmariadb-git-f284ce04c482cb49175cbd5d9870e12cf5d08943.tar.gz
now we allow to careate VIEW without any privileges on view columns (except create view privilege) (BUG#5152)
mysql-test/r/view.result: now we allow to careate VIEW without any privileges on view columns (except create view privilege) test of blocking try of getting more privileges on colemn with vierw using mysql-test/t/view.test: now we allow to careate VIEW without any privileges on view columns (except create view privilege) test of blocking try of getting more privileges on colemn with vierw using sql/sql_view.cc: now we allow to careate VIEW without any privileges on view columns (except create view privilege)
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc21
1 files changed, 2 insertions, 19 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 8238d3d4849..178c01687b0 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -245,10 +245,9 @@ int mysql_create_view(THD *thd,
if ((fld= item->filed_for_view_update()))
{
/*
- There are no any privileges on VIEW column or there are
- some other privileges then we have for underlaying table
+ Do we have more privilegeson view field then underlying table field
*/
- if (priv == 0 || (~fld->have_privileges & priv))
+ if ((~fld->have_privileges & priv))
{
/* VIEW column has more privileges */
my_printf_error(ER_COLUMNACCESS_DENIED_ERROR,
@@ -262,22 +261,6 @@ int mysql_create_view(THD *thd,
DBUG_RETURN(-1);
}
}
- else
- {
- if (!(priv & SELECT_ACL))
- {
- /* user have not privilege to SELECT expression */
- my_printf_error(ER_COLUMNACCESS_DENIED_ERROR,
- ER(ER_COLUMNACCESS_DENIED_ERROR),
- MYF(0),
- "select",
- thd->priv_user,
- thd->host_or_ip,
- item->name,
- view->real_name);
- DBUG_RETURN(-1);
- }
- }
}
}
#endif