Commit 4246f400 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fixed case when frivileges check switched off (BUG#4631)

parent 3e40d596
drop table if exists t1,t2;
drop view if exists v1,v2,v3,v4,v5,v6;
drop table if exists t1,t2,v1,v2,v3,v4,v5,v6;
drop view if exists t1,t2,v1,v2,v3,v4,v5,v6;
drop database if exists mysqltest;
use test;
create view v1 (c,d) as select a,b from t1;
......
drop table if exists t1,v1;
drop view if exists t1,v1;
use test;
create table t1 (field1 INT);
CREATE VIEW v1 AS SELECT field1 FROM t1;
drop view v1;
--disable_warnings
drop table if exists t1,t2;
drop view if exists v1,v2,v3,v4,v5,v6;
drop table if exists t1,t2,v1,v2,v3,v4,v5,v6;
drop view if exists t1,t2,v1,v2,v3,v4,v5,v6;
drop database if exists mysqltest;
--enable_warnings
use test;
......
--disable_warnings
drop table if exists t1,v1;
drop view if exists t1,v1;
--enable_warnings
use test;
#
# test that we can create VIEW if privileges check switched off
#
create table t1 (field1 INT);
CREATE VIEW v1 AS SELECT field1 FROM t1;
drop view v1;
drop table t1
......@@ -3838,6 +3838,11 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
{
/* global privileges */
grant->privilege= thd->master_access;
/* if privileges ignored (--skip-grant-tables) above is enough */
if (!grant_option)
return;
/* db privileges */
grant->privilege|= acl_get(thd->host, thd->ip, thd->priv_user, db, 0);
/* table privileges */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment