| 1 |
drop database if exists events_test; |
| 2 |
drop database if exists mysqltest_db2; |
| 3 |
create database events_test; |
| 4 |
use events_test; |
| 5 |
create user mysqltest_user1@localhost; |
| 6 |
grant create, insert, select, delete on mysqltest_db2.* |
| 7 |
to mysqltest_user1@localhost; |
| 8 |
create database mysqltest_db2; |
| 9 |
connect conn1,localhost,mysqltest_user1,,mysqltest_db2; |
| 10 |
set autocommit=off; |
| 11 |
select @@autocommit; |
| 12 |
@@autocommit |
| 13 |
0 |
| 14 |
create table t1 (a varchar(255)) engine=innodb; |
| 15 |
begin work; |
| 16 |
insert into t1 (a) values ("OK: create event: insufficient privileges"); |
| 17 |
create event e1 on schedule every 1 day do select 1; |
| 18 |
ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' |
| 19 |
rollback work; |
| 20 |
select * from t1; |
| 21 |
a |
| 22 |
OK: create event: insufficient privileges |
| 23 |
delete from t1; |
| 24 |
commit work; |
| 25 |
begin work; |
| 26 |
insert into t1 (a) values ("OK: alter event: insufficient privileges"); |
| 27 |
alter event e1 on schedule every 1 day do select 1; |
| 28 |
ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' |
| 29 |
rollback work; |
| 30 |
select * from t1; |
| 31 |
a |
| 32 |
OK: alter event: insufficient privileges |
| 33 |
delete from t1; |
| 34 |
commit work; |
| 35 |
begin work; |
| 36 |
insert into t1 (a) values ("OK: drop event: insufficient privileges"); |
| 37 |
drop event e1; |
| 38 |
ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db2' |
| 39 |
rollback work; |
| 40 |
select * from t1; |
| 41 |
a |
| 42 |
OK: drop event: insufficient privileges |
| 43 |
delete from t1; |
| 44 |
commit work; |
| 45 |
disconnect conn1; |
| 46 |
connection default; |
| 47 |
drop user mysqltest_user1@localhost; |
| 48 |
drop database mysqltest_db2; |
| 49 |
drop database events_test; |