| 1 |
--source include/not_embedded.inc |
| 2 |
--source include/default_charset.inc |
| 3 |
|
| 4 |
drop database if exists db; |
| 5 |
|
| 6 |
create role r1; |
| 7 |
create user beep@'%'; |
| 8 |
|
| 9 |
create database db; |
| 10 |
create table db.t1 (i int); |
| 11 |
create table db.t2 (b int); |
| 12 |
grant select on db.* to r1; |
| 13 |
grant r1 to beep@'%'; |
| 14 |
|
| 15 |
--connect (con1,localhost,beep,,) |
| 16 |
show databases; |
| 17 |
--error ER_DBACCESS_DENIED_ERROR |
| 18 |
show create database db; |
| 19 |
select table_schema, table_name from information_schema.tables |
| 20 |
where table_schema = 'db' order by table_name; |
| 21 |
|
| 22 |
set role r1; |
| 23 |
show databases; |
| 24 |
show create database db; |
| 25 |
select table_schema, table_name from information_schema.tables |
| 26 |
where table_schema = 'db' order by table_name; |
| 27 |
|
| 28 |
|
| 29 |
connection default; |
| 30 |
create role r2; |
| 31 |
create user beep2@'%'; |
| 32 |
|
| 33 |
grant update on db.* to r2; |
| 34 |
grant r2 to beep2; |
| 35 |
--connect (con2,localhost,beep2,,) |
| 36 |
show databases; |
| 37 |
--error ER_DBACCESS_DENIED_ERROR |
| 38 |
show create database db; |
| 39 |
select table_schema, table_name from information_schema.tables |
| 40 |
where table_schema = 'db' order by table_name; |
| 41 |
|
| 42 |
set role r2; |
| 43 |
show databases; |
| 44 |
|
| 45 |
show create database db; |
| 46 |
select table_schema, table_name from information_schema.tables |
| 47 |
where table_schema = 'db' order by table_name; |
| 48 |
|
| 49 |
|
| 50 |
connection default; |
| 51 |
|
| 52 |
drop database db; |
| 53 |
drop role r1; |
| 54 |
drop user beep; |
| 55 |
drop role r2; |
| 56 |
drop user beep2; |