From f284ce04c482cb49175cbd5d9870e12cf5d08943 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Sep 2004 00:16:57 +0300 Subject: 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) --- sql/sql_view.cc | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'sql/sql_view.cc') 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 -- cgit v1.2.1