Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. --disable_warnings
  2. create database mysqltest;
  3. --enable_warnings
  4. create table mysqltest.t1 (a int, b int);
  5. create view mysqltest.v1 (c,d) as with t as
  6. select (a from mysqltest.t1 where a>=3) select a,b from t,t1 where mysqltest.t1.a = t.a;
  7. grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
  8.  
  9. connection user1;
  10. select c from mysqltest.v1;
  11. # there are no privileges on column 'd'
  12. --error ER_COLUMNACCESS_DENIED_ERROR
  13. select d from mysqltest.v1;
  14.  
  15. connection root;
  16. revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
  17. drop user mysqltest_1@localhost;
  18. drop database mysqltest;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement