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)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user