1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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)
This commit is contained in:
unknown
2004-09-17 00:16:57 +03:00
parent 29ec367edd
commit f284ce04c4
3 changed files with 23 additions and 29 deletions

View File

@ -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